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
d3c45fb7
Commit
d3c45fb7
authored
Sep 24, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
键盘性能优化
parent
6a8d86c2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
editor.js
src/module/editor.js
+15
-4
No files found.
src/module/editor.js
View file @
d3c45fb7
...
@@ -12,7 +12,7 @@ KityMinder.registerModule('TextEditModule', function() {
...
@@ -12,7 +12,7 @@ KityMinder.registerModule('TextEditModule', function() {
//鼠标被点击,并未太抬起时为真
//鼠标被点击,并未太抬起时为真
var
mouseDownStatus
=
false
;
var
mouseDownStatus
=
false
;
var
mouseupTimer
;
//当前是否有选区存在
//当前是否有选区存在
var
selectionReadyShow
=
false
;
var
selectionReadyShow
=
false
;
...
@@ -109,6 +109,7 @@ KityMinder.registerModule('TextEditModule', function() {
...
@@ -109,6 +109,7 @@ KityMinder.registerModule('TextEditModule', function() {
textGroup
.
setStyle
(
'cursor'
,
'text'
);
textGroup
.
setStyle
(
'cursor'
,
'text'
);
sel
.
setShowStatus
();
sel
.
setShowStatus
();
setTimeout
(
function
()
{
setTimeout
(
function
()
{
sel
.
collapse
(
true
)
sel
.
collapse
(
true
)
.
updatePosition
(
receiver
.
getOffsetByIndex
())
.
updatePosition
(
receiver
.
getOffsetByIndex
())
.
setShow
();
.
setShow
();
...
@@ -129,7 +130,10 @@ KityMinder.registerModule('TextEditModule', function() {
...
@@ -129,7 +130,10 @@ KityMinder.registerModule('TextEditModule', function() {
},
},
'inputready.keyup'
:
function
(
e
){
'inputready.keyup'
:
function
(
e
){
if
(
sel
.
isHide
()){
if
(
sel
.
isHide
()){
inputStatusReady
(
this
.
getSelectedNode
());
var
me
=
this
;
setTimeout
(
function
(){
inputStatusReady
(
me
.
getSelectedNode
());
});
}
}
},
},
...
@@ -145,7 +149,10 @@ KityMinder.registerModule('TextEditModule', function() {
...
@@ -145,7 +149,10 @@ KityMinder.registerModule('TextEditModule', function() {
!
orgEvt
.
metaKey
&&
!
orgEvt
.
metaKey
&&
!
orgEvt
.
shiftKey
&&
!
orgEvt
.
shiftKey
&&
!
orgEvt
.
altKey
)
{
!
orgEvt
.
altKey
)
{
setTimeout
(
function
(){
inputStatusReady
(
node
);
inputStatusReady
(
node
);
})
}
}
}
}
}
}
...
@@ -173,7 +180,7 @@ KityMinder.registerModule('TextEditModule', function() {
...
@@ -173,7 +180,7 @@ KityMinder.registerModule('TextEditModule', function() {
receiver
.
focus
();
receiver
.
focus
();
}
}
setTimeout
(
function
()
{
mouseupTimer
=
setTimeout
(
function
()
{
sel
.
collapse
(
true
)
sel
.
collapse
(
true
)
.
updatePosition
(
receiver
.
getOffsetByIndex
())
.
updatePosition
(
receiver
.
getOffsetByIndex
())
.
setShow
();
.
setShow
();
...
@@ -231,11 +238,15 @@ KityMinder.registerModule('TextEditModule', function() {
...
@@ -231,11 +238,15 @@ KityMinder.registerModule('TextEditModule', function() {
var
node
=
e
.
getTargetNode
();
var
node
=
e
.
getTargetNode
();
if
(
node
){
if
(
node
){
//清理mouseup的timer
clearTimeout
(
mouseupTimer
);
inputStatusReady
(
node
);
inputStatusReady
(
node
);
km
.
setStatus
(
'textedit'
);
km
.
setStatus
(
'textedit'
);
receiver
.
updateSelection
();
receiver
.
updateSelection
();
}
}
},
},
...
...
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