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
b5904d59
Commit
b5904d59
authored
Oct 13, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复快捷键
parent
66c1c1d8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
+13
-13
editor.js
src/module/editor.js
+2
-2
editor.keyboard.js
src/module/editor.keyboard.js
+9
-9
editor.selection.js
src/module/editor.selection.js
+1
-1
view.js
src/module/view.js
+1
-1
No files found.
src/module/editor.js
View file @
b5904d59
...
@@ -112,7 +112,6 @@ KityMinder.registerModule('TextEditModule', function() {
...
@@ -112,7 +112,6 @@ KityMinder.registerModule('TextEditModule', function() {
.
setRange
(
range
)
.
setRange
(
range
)
.
setReady
();
.
setReady
();
if
(
selectionReadyShow
){
if
(
selectionReadyShow
){
...
@@ -124,12 +123,13 @@ KityMinder.registerModule('TextEditModule', function() {
...
@@ -124,12 +123,13 @@ KityMinder.registerModule('TextEditModule', function() {
dblclickEvent
=
false
;
dblclickEvent
=
false
;
return
;
return
;
}
}
sel
.
collapse
(
true
)
sel
.
collapse
(
true
)
.
updatePosition
(
receiver
.
getOffsetByIndex
())
.
updatePosition
(
receiver
.
getOffsetByIndex
())
.
setShow
();
.
setShow
();
textGroup
.
setStyle
(
'cursor'
,
'text'
);
textGroup
.
setStyle
(
'cursor'
,
'text'
);
},
200
);
},
200
);
km
.
setStatus
(
'textedit'
);
km
.
setStatus
(
'textedit'
);
}
}
...
...
src/module/editor.keyboard.js
View file @
b5904d59
...
@@ -53,7 +53,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
...
@@ -53,7 +53,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
this
.
_keyup
(
e
);
this
.
_keyup
(
e
);
}
}
},
},
_setTextToContainer
:
function
(
keyCode
){
_setTextToContainer
:
function
(
keyCode
,
iskeyUp
){
var
me
=
this
;
var
me
=
this
;
//同步节点
//同步节点
me
.
minderNode
=
me
.
re
.
minderNode
;
me
.
minderNode
=
me
.
re
.
minderNode
;
...
@@ -65,7 +65,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
...
@@ -65,7 +65,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
}
}
if
(
keymap
.
controlKeys
[
keyCode
]){
if
(
keymap
.
controlKeys
[
keyCode
]
&&
!
iskeyUp
){
return
;
return
;
}
}
//当第一次输入内容时进行保存
//当第一次输入内容时进行保存
...
@@ -98,6 +98,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
...
@@ -98,6 +98,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
},
300
);
},
300
);
}
}
me
.
re
.
updateTextOffsetData
()
me
.
re
.
updateTextOffsetData
()
.
updateRange
()
.
updateRange
()
.
updateSelectionByRange
();
.
updateSelectionByRange
();
...
@@ -193,7 +194,6 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
...
@@ -193,7 +194,6 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
//修正在cvs方式下_keyup会把节点文字选中
//修正在cvs方式下_keyup会把节点文字选中
this
.
isShortcutCopyKey
=
true
;
this
.
isShortcutCopyKey
=
true
;
this
.
km
.
setStatus
(
'normal'
);
this
.
km
.
setStatus
(
'normal'
);
return
;
return
;
}
}
...
@@ -241,7 +241,6 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
...
@@ -241,7 +241,6 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
me
.
_setTextToContainer
(
keyCode
);
me
.
_setTextToContainer
(
keyCode
);
},
},
_beforeKeyup
:
function
(
e
){
_beforeKeyup
:
function
(
e
){
var
me
=
this
;
var
me
=
this
;
var
orgEvt
=
e
.
originEvent
;
var
orgEvt
=
e
.
originEvent
;
var
keyCode
=
orgEvt
.
keyCode
;
var
keyCode
=
orgEvt
.
keyCode
;
...
@@ -265,7 +264,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
...
@@ -265,7 +264,7 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
}
}
if
(
keymap
.
Enter
==
keyCode
&&
(
this
.
isTypeText
||
browser
.
mac
&&
browser
.
gecko
))
{
if
(
keymap
.
Enter
==
keyCode
&&
(
this
.
isTypeText
||
browser
.
mac
&&
browser
.
gecko
))
{
me
.
_setTextToContainer
(
keyCode
);
me
.
_setTextToContainer
(
keyCode
,
true
);
}
}
if
(
this
.
re
.
keydownNode
===
this
.
re
.
minderNode
)
{
if
(
this
.
re
.
keydownNode
===
this
.
re
.
minderNode
)
{
this
.
km
.
rollbackStatus
();
this
.
km
.
rollbackStatus
();
...
@@ -283,19 +282,20 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
...
@@ -283,19 +282,20 @@ Minder.keyboarder = kity.createClass('keyboarder', function(){
}
}
}
}
me
.
_setTextToContainer
(
keyCode
);
me
.
_setTextToContainer
(
keyCode
,
true
);
return
;
return
;
}
}
if
(
this
.
isTypeText
)
{
if
(
this
.
isTypeText
)
{
me
.
_setTextToContainer
(
keyCode
);
me
.
_setTextToContainer
(
keyCode
,
true
);
return
;
return
;
}
}
if
(
browser
.
mac
&&
browser
.
gecko
){
if
(
browser
.
mac
&&
browser
.
gecko
){
me
.
_setTextToContainer
(
keyCode
);
me
.
_setTextToContainer
(
keyCode
,
true
);
return
;
return
;
}
}
me
.
_setTextToContainer
(
keyCode
);
me
.
_setTextToContainer
(
keyCode
,
true
);
return
true
;
return
true
;
},
},
...
...
src/module/editor.selection.js
View file @
b5904d59
...
@@ -86,7 +86,7 @@ Minder.Selection = kity.createClass( 'Selection', {
...
@@ -86,7 +86,7 @@ Minder.Selection = kity.createClass( 'Selection', {
'z'
];
'z'
];
};
};
offset
=
offset
||
this
.
offset
;
offset
=
offset
!==
undefined
?
offset
:
this
.
offset
;
if
(
this
.
collapsed
){
if
(
this
.
collapsed
){
if
(
isNaN
(
offset
.
x
)
||
isNaN
(
offset
.
y
))
{
if
(
isNaN
(
offset
.
x
)
||
isNaN
(
offset
.
y
))
{
...
...
src/module/view.js
View file @
b5904d59
...
@@ -232,7 +232,7 @@ KityMinder.registerModule('View', function() {
...
@@ -232,7 +232,7 @@ KityMinder.registerModule('View', function() {
var
minder
=
this
;
var
minder
=
this
;
[
'up'
,
'down'
,
'left'
,
'right'
].
forEach
(
function
(
name
)
{
[
'up'
,
'down'
,
'left'
,
'right'
].
forEach
(
function
(
name
)
{
if
(
e
.
isShortcutKey
(
'ctrl+'
+
name
))
{
if
(
e
.
isShortcutKey
(
'ctrl+'
+
name
)
&&
minder
.
getStatus
()
!=
'textedit'
)
{
minder
.
removeAllSelectedNodes
();
minder
.
removeAllSelectedNodes
();
minder
.
execCommand
(
'move'
,
name
,
100
);
minder
.
execCommand
(
'move'
,
name
,
100
);
e
.
preventDefault
();
e
.
preventDefault
();
...
...
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