Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kityminder-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
吴志俊
kityminder-core
Commits
7072e273
Commit
7072e273
authored
May 16, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge hot-fix
parent
cabdf85f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
editor.receiver.js
src/module/editor.receiver.js
+10
-11
No files found.
src/module/editor.receiver.js
View file @
7072e273
...
@@ -141,7 +141,6 @@ Minder.Receiver = kity.createClass( 'Receiver', {
...
@@ -141,7 +141,6 @@ Minder.Receiver = kity.createClass( 'Receiver', {
this
.
km
.
setStatus
(
'normal'
);
this
.
km
.
setStatus
(
'normal'
);
e
.
preventDefault
();
e
.
preventDefault
();
return
;
return
;
break
;
case
keymap
.
Shift
:
case
keymap
.
Shift
:
case
keymap
.
Control
:
case
keymap
.
Control
:
case
keymap
.
Alt
:
case
keymap
.
Alt
:
...
@@ -256,7 +255,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
...
@@ -256,7 +255,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
},
},
setContainerStyle
:
function
()
{
setContainerStyle
:
function
()
{
var
textShapeBox
=
this
.
getBaseOffset
(
'screen'
);
var
textShapeBox
=
this
.
getBaseOffset
(
'screen'
);
this
.
container
.
style
.
cssText
=
";left:"
+
textShapeBox
.
x
+
'px;top:'
+
(
textShapeBox
.
y
+
textShapeBox
.
height
*
.
1
)
+
'px;width:'
+
textShapeBox
.
width
+
'px;height:'
+
textShapeBox
.
height
+
'px;'
;
this
.
container
.
style
.
cssText
=
";left:"
+
textShapeBox
.
x
+
'px;top:'
+
(
textShapeBox
.
y
+
textShapeBox
.
height
*
0
.1
)
+
'px;width:'
+
textShapeBox
.
width
+
'px;height:'
+
textShapeBox
.
height
+
'px;'
;
if
(
!
this
.
selection
.
isShow
()
)
{
if
(
!
this
.
selection
.
isShow
()
)
{
var
paperContainer
=
this
.
km
.
getPaper
();
var
paperContainer
=
this
.
km
.
getPaper
();
...
@@ -335,7 +334,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
...
@@ -335,7 +334,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
var
me
=
this
;
var
me
=
this
;
utils
.
each
(
this
.
textData
,
function
(
i
,
v
)
{
utils
.
each
(
this
.
textData
,
function
(
i
,
v
)
{
//点击开始之前
//点击开始之前
if
(
i
==
0
&&
offset
.
x
<=
v
.
x
)
{
if
(
i
==
=
0
&&
offset
.
x
<=
v
.
x
)
{
me
.
selection
.
setStartOffset
(
0
);
me
.
selection
.
setStartOffset
(
0
);
return
false
;
return
false
;
}
}
...
@@ -347,18 +346,18 @@ Minder.Receiver = kity.createClass( 'Receiver', {
...
@@ -347,18 +346,18 @@ Minder.Receiver = kity.createClass( 'Receiver', {
if
(
offset
.
x
>=
v
.
x
&&
offset
.
x
<=
v
.
x
+
v
.
width
)
{
if
(
offset
.
x
>=
v
.
x
&&
offset
.
x
<=
v
.
x
+
v
.
width
)
{
if
(
me
.
index
==
i
)
{
if
(
me
.
index
==
i
)
{
if
(
i
==
0
)
{
if
(
i
==
=
0
)
{
me
.
selection
.
setStartOffset
(
i
)
me
.
selection
.
setStartOffset
(
i
)
;
}
}
if
(
offset
.
x
<=
v
.
x
+
v
.
width
/
2
)
{
if
(
offset
.
x
<=
v
.
x
+
v
.
width
/
2
)
{
me
.
selection
.
collapse
()
me
.
selection
.
collapse
()
;
}
else
{
}
else
{
me
.
selection
.
setEndOffset
(
i
+
(
(
me
.
selection
.
endOffset
>
i
||
dir
==
1
)
&&
i
!=
me
.
textData
.
length
-
1
?
1
:
0
)
)
me
.
selection
.
setEndOffset
(
i
+
(
(
me
.
selection
.
endOffset
>
i
||
dir
==
1
)
&&
i
!=
me
.
textData
.
length
-
1
?
1
:
0
)
)
;
}
}
}
else
if
(
i
>
me
.
index
)
{
}
else
if
(
i
>
me
.
index
)
{
me
.
selection
.
setStartOffset
(
me
.
index
);
me
.
selection
.
setStartOffset
(
me
.
index
);
me
.
selection
.
setEndOffset
(
i
+
1
)
me
.
selection
.
setEndOffset
(
i
+
1
)
;
}
else
{
}
else
{
if
(
dir
==
1
)
{
if
(
dir
==
1
)
{
me
.
selection
.
setStartOffset
(
i
+
(
offset
.
x
>=
v
.
x
+
v
.
width
/
2
&&
i
!=
me
.
textData
.
length
-
1
?
1
:
0
)
);
me
.
selection
.
setStartOffset
(
i
+
(
offset
.
x
>=
v
.
x
+
v
.
width
/
2
&&
i
!=
me
.
textData
.
length
-
1
?
1
:
0
)
);
...
@@ -366,7 +365,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
...
@@ -366,7 +365,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
me
.
selection
.
setStartOffset
(
i
);
me
.
selection
.
setStartOffset
(
i
);
}
}
me
.
selection
.
setEndOffset
(
me
.
index
)
me
.
selection
.
setEndOffset
(
me
.
index
)
;
}
}
return
false
;
return
false
;
...
@@ -387,7 +386,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
...
@@ -387,7 +386,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
var
lastOffset
=
this
.
textData
[
this
.
textData
.
length
-
1
];
var
lastOffset
=
this
.
textData
[
this
.
textData
.
length
-
1
];
width
=
lastOffset
.
x
-
startOffset
.
x
+
lastOffset
.
width
;
width
=
lastOffset
.
x
-
startOffset
.
x
+
lastOffset
.
width
;
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
'e'
)
console
.
log
(
'e'
)
;
}
}
}
else
{
}
else
{
...
@@ -406,7 +405,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
...
@@ -406,7 +405,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
},
},
setIndex
:
function
(
index
)
{
setIndex
:
function
(
index
)
{
this
.
index
=
index
;
this
.
index
=
index
;
return
this
return
this
;
},
},
setContainerTxt
:
function
(
txt
)
{
setContainerTxt
:
function
(
txt
)
{
this
.
container
.
textContent
=
txt
;
this
.
container
.
textContent
=
txt
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment