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
b3533d2c
Commit
b3533d2c
authored
Mar 18, 2014
by
techird
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:fex-team/kityminder into dev
parents
b182d9c1
21f0c0d5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
52 deletions
+47
-52
CHANGELOG.md
CHANGELOG.md
+2
-0
minder.js
src/core/minder.js
+45
-44
layout.default.js
src/module/layout.default.js
+0
-8
No files found.
CHANGELOG.md
View file @
b3533d2c
...
...
@@ -6,3 +6,5 @@
1.
添加了粘贴剪贴复制功能
### 问题修复
1.
修正了bottom主题的位置问题
2.
修正了子节点全部删除后展开/收缩标志依然存在画布上的问题
src/core/minder.js
View file @
b3533d2c
...
...
@@ -28,7 +28,7 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
this
.
_paper
=
new
kity
.
Paper
();
this
.
_paper
.
getNode
().
setAttribute
(
'contenteditable'
,
true
);
this
.
_paper
.
getNode
().
ondragstart
=
function
(
e
)
{
this
.
_paper
.
getNode
().
ondragstart
=
function
(
e
)
{
e
.
preventDefault
();
};
...
...
@@ -64,47 +64,48 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
this
.
_shortcutkeys
=
{};
this
.
_bindshortcutKeys
();
},
isTextEditStatus
:
function
()
{
isTextEditStatus
:
function
()
{
return
false
;
},
addShortcutKeys
:
function
(
cmd
,
keys
)
{
var
obj
=
{},
km
=
this
;
var
obj
=
{},
km
=
this
;
if
(
keys
)
{
obj
[
cmd
]
=
keys
}
else
{
obj
=
cmd
;
}
utils
.
each
(
obj
,
function
(
k
,
v
)
{
km
.
_shortcutkeys
[
k
.
toLowerCase
()
]
=
v
;
});
utils
.
each
(
obj
,
function
(
k
,
v
)
{
km
.
_shortcutkeys
[
k
.
toLowerCase
()
]
=
v
;
}
);
},
getShortcutKey
:
function
(
cmdName
)
{
return
this
.
_shortcutkeys
[
cmdName
]
getShortcutKey
:
function
(
cmdName
)
{
return
this
.
_shortcutkeys
[
cmdName
]
},
_bindshortcutKeys
:
function
()
{
var
me
=
this
,
shortcutkeys
=
this
.
_shortcutkeys
;
function
checkkey
(
key
,
keyCode
,
e
){
switch
(
key
){
function
checkkey
(
key
,
keyCode
,
e
)
{
switch
(
key
)
{
case
'ctrl'
:
case
'cmd'
:
if
(
e
.
ctrlKey
||
e
.
metaKey
)
{
if
(
e
.
ctrlKey
||
e
.
metaKey
)
{
return
true
;
}
break
;
case
'alt'
:
if
(
e
.
altKey
)
{
if
(
e
.
altKey
)
{
return
true
}
break
;
case
'shift'
:
if
(
e
.
shiftKey
)
{
if
(
e
.
shiftKey
)
{
return
true
;
}
}
if
(
keyCode
==
keymap
[
key
])
{
if
(
keyCode
==
keymap
[
key
]
)
{
return
true
;
}
return
false
...
...
@@ -114,15 +115,15 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
var
originEvent
=
e
.
originEvent
;
var
keyCode
=
originEvent
.
keyCode
||
originEvent
.
which
;
for
(
var
i
in
shortcutkeys
)
{
var
keys
=
shortcutkeys
[
i
].
toLowerCase
().
split
(
'+'
);
var
keys
=
shortcutkeys
[
i
].
toLowerCase
().
split
(
'+'
);
var
current
=
0
;
utils
.
each
(
keys
,
function
(
i
,
k
)
{
if
(
checkkey
(
k
,
keyCode
,
originEvent
))
{
utils
.
each
(
keys
,
function
(
i
,
k
)
{
if
(
checkkey
(
k
,
keyCode
,
originEvent
)
)
{
current
++
;
}
});
}
);
if
(
current
==
keys
.
length
)
{
if
(
current
==
keys
.
length
)
{
if
(
me
.
queryCommandState
(
i
)
!=
-
1
)
me
.
execCommand
(
i
);
originEvent
.
preventDefault
();
...
...
@@ -132,38 +133,38 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
}
}
);
},
_initContextmenu
:
function
()
{
_initContextmenu
:
function
()
{
this
.
contextmenus
=
[];
},
addContextmenu
:
function
(
item
)
{
if
(
utils
.
isArray
(
item
))
{
this
.
contextmenus
=
this
.
contextmenus
.
concat
(
item
);
}
else
{
this
.
contextmenus
.
push
(
item
);
addContextmenu
:
function
(
item
)
{
if
(
utils
.
isArray
(
item
)
)
{
this
.
contextmenus
=
this
.
contextmenus
.
concat
(
item
);
}
else
{
this
.
contextmenus
.
push
(
item
);
}
return
this
;
},
getContextmenu
:
function
()
{
getContextmenu
:
function
()
{
return
this
.
contextmenus
;
},
_initStatus
:
function
()
{
_initStatus
:
function
()
{
this
.
_status
=
"normal"
;
this
.
_rollbackStatus
=
"normal"
;
},
setStatus
:
function
(
status
)
{
if
(
status
)
{
setStatus
:
function
(
status
)
{
if
(
status
)
{
this
.
_rollbackStatus
=
this
.
_status
;
this
.
_status
=
status
;
}
else
{
}
else
{
this
.
_status
=
''
;
}
return
this
;
},
rollbackStatus
:
function
()
{
rollbackStatus
:
function
()
{
this
.
_status
=
this
.
_rollbackStatus
;
},
getStatus
:
function
()
{
getStatus
:
function
()
{
return
this
.
_status
;
}
}
);
...
...
src/module/layout.default.js
View file @
b3533d2c
...
...
@@ -551,14 +551,6 @@ KityMinder.registerModule( "LayoutDefault", function () {
node
.
setType
(
"main"
);
}
else
{
node
.
setType
(
"sub"
);
var
isExpand
=
parent
.
getData
(
"expand"
);
if
(
isExpand
===
undefined
)
{
isExpand
=
true
;
parent
.
setData
(
"expand"
,
isExpand
);
}
// if ( !isExpand ) {
// return false;
// }
}
//计算位置等流程
updateBg
(
node
);
...
...
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