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
5ee66b33
Commit
5ee66b33
authored
Jul 08, 2014
by
techird
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release-1.2.0' of github.com:fex-team/kityminder into release-1.2.0
parents
973140e3
a3b39ce9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
11 deletions
+26
-11
editor.js
src/module/editor.js
+15
-6
editor.receiver.js
src/module/editor.receiver.js
+11
-5
No files found.
src/module/editor.js
View file @
5ee66b33
...
@@ -261,9 +261,12 @@ KityMinder.registerModule('TextEditModule', function() {
...
@@ -261,9 +261,12 @@ KityMinder.registerModule('TextEditModule', function() {
}
}
receiver
.
clear
();
// receiver.clear();
if
(
this
.
getStatus
()
==
'textedit'
)
{
// if (this.getStatus() == 'textedit') {
this
.
setStatus
(
'normal'
);
// this.setStatus('normal');
// }
if
(
sel
.
isShow
()){
receiver
.
updateTextOffsetData
().
updateSelection
()
}
}
},
},
'layoutfinish'
:
function
(
e
){
'layoutfinish'
:
function
(
e
){
...
@@ -271,12 +274,18 @@ KityMinder.registerModule('TextEditModule', function() {
...
@@ -271,12 +274,18 @@ KityMinder.registerModule('TextEditModule', function() {
receiver
receiver
.
setBaseOffset
()
.
setBaseOffset
()
.
setContainerStyle
();
.
setContainerStyle
();
}
}
},
},
'selectionclear'
:
function
()
{
'selectionclear'
:
function
()
{
km
.
setStatus
(
'normal'
);
var
node
=
km
.
getSelectedNode
();
receiver
.
clear
();
if
(
node
){
inputStatusReady
(
node
);
}
else
{
km
.
setStatus
(
'normal'
);
receiver
.
clear
();
}
},
},
'blur'
:
function
()
{
'blur'
:
function
()
{
receiver
.
clear
();
receiver
.
clear
();
...
...
src/module/editor.receiver.js
View file @
5ee66b33
...
@@ -20,7 +20,9 @@ Minder.Receiver = kity.createClass('Receiver', {
...
@@ -20,7 +20,9 @@ Minder.Receiver = kity.createClass('Receiver', {
var
_div
=
document
.
createElement
(
'div'
);
var
_div
=
document
.
createElement
(
'div'
);
_div
.
setAttribute
(
'contenteditable'
,
true
);
_div
.
setAttribute
(
'contenteditable'
,
true
);
_div
.
className
=
'km_receiver'
;
_div
.
className
=
'km_receiver'
;
this
.
container
=
_div
;
this
.
container
=
_div
;
if
(
browser
.
ipad
)
{
if
(
browser
.
ipad
)
{
utils
.
listen
(
this
.
container
,
'keydown keypress keyup input'
,
function
(
e
)
{
utils
.
listen
(
this
.
container
,
'keydown keypress keyup input'
,
function
(
e
)
{
me
.
keyboardEvents
.
call
(
me
,
new
MinderEvent
(
e
.
type
==
'keyup'
?
'beforekeyup'
:
e
.
type
,
e
));
me
.
keyboardEvents
.
call
(
me
,
new
MinderEvent
(
e
.
type
==
'keyup'
?
'beforekeyup'
:
e
.
type
,
e
));
...
@@ -229,8 +231,8 @@ Minder.Receiver = kity.createClass('Receiver', {
...
@@ -229,8 +231,8 @@ Minder.Receiver = kity.createClass('Receiver', {
case
keymap
.
Alt
:
case
keymap
.
Alt
:
case
keymap
.
Cmd
:
case
keymap
.
Cmd
:
case
keymap
.
F2
:
case
keymap
.
F2
:
case
keymap
.
Del
:
//
case keymap.Del:
case
keymap
.
Backspace
:
//
case keymap.Backspace:
if
(
this
.
selection
.
isHide
()){
if
(
this
.
selection
.
isHide
()){
this
.
km
.
setStatus
(
'normal'
);
this
.
km
.
setStatus
(
'normal'
);
}
}
...
@@ -323,9 +325,9 @@ Minder.Receiver = kity.createClass('Receiver', {
...
@@ -323,9 +325,9 @@ Minder.Receiver = kity.createClass('Receiver', {
}
}
return
;
return
;
}
}
setTimeout
(
function
()
{
//针对不能连续删除做处理
if
(
keymap
.
Del
||
keymap
.
Backspace
)
setTextToContainer
(
keyCode
);
setTextToContainer
(
keyCode
);
});
break
;
break
;
case
'beforekeyup'
:
case
'beforekeyup'
:
...
@@ -370,9 +372,13 @@ Minder.Receiver = kity.createClass('Receiver', {
...
@@ -370,9 +372,13 @@ Minder.Receiver = kity.createClass('Receiver', {
}
}
if
(
this
.
isTypeText
)
{
if
(
this
.
isTypeText
)
{
setTextToContainer
(
keyCode
);
setTextToContainer
(
keyCode
);
return
;
}
}
if
(
browser
.
mac
&&
browser
.
gecko
)
if
(
browser
.
mac
&&
browser
.
gecko
)
{
setTextToContainer
(
keyCode
);
setTextToContainer
(
keyCode
);
return
;
}
setTextToContainer
(
keyCode
);
return
true
;
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