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
0a9329d1
Commit
0a9329d1
authored
Apr 30, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化输入文字体验
parent
fd624c72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
editor.receiver.js
src/module/editor.receiver.js
+19
-3
No files found.
src/module/editor.receiver.js
View file @
0a9329d1
...
...
@@ -23,7 +23,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
_div
.
className
=
'km_receiver'
;
this
.
container
=
document
.
body
.
insertBefore
(
_div
,
document
.
body
.
firstChild
);
utils
.
addCssRule
(
'km_receiver_css'
,
' .km_receiver{position:absolute;padding:0;margin:0;word-wrap:break-word;clip:rect(1em 1em 1em 1em);}'
);
//
this
.
km
.
on
(
'textedit.beforekeyup textedit.keydown textedit.paste'
,
utils
.
proxy
(
this
.
keyboardEvents
,
this
)
);
this
.
km
.
on
(
'textedit.beforekeyup textedit.keydown textedit.
keypress textedit.
paste'
,
utils
.
proxy
(
this
.
keyboardEvents
,
this
)
);
this
.
timer
=
null
;
this
.
index
=
0
;
},
...
...
@@ -107,9 +107,13 @@ Minder.Receiver = kity.createClass( 'Receiver', {
me
.
selection
.
setShow
()
},
500
);
}
var
isTypeText
=
false
;
var
isKeypress
=
false
;
switch
(
e
.
type
)
{
case
'keydown'
:
isTypeText
=
false
;
isKeypress
=
false
;
switch
(
e
.
originEvent
.
keyCode
)
{
case
keys
.
Enter
:
case
keys
.
Tab
:
...
...
@@ -149,8 +153,18 @@ Minder.Receiver = kity.createClass( 'Receiver', {
}
return
;
}
setTextToContainer
();
isTypeText
=
true
;
break
;
case
'keypress'
:
if
(
isTypeText
)
setTextToContainer
();
isKeypress
=
true
;
break
;
case
'beforekeyup'
:
...
...
@@ -168,7 +182,9 @@ Minder.Receiver = kity.createClass( 'Receiver', {
}
if
(
!
isKeypress
){
setTextToContainer
();
}
return
true
;
}
...
...
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