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
50d3aa4b
Commit
50d3aa4b
authored
Jul 02, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改进了undo/redo的交互方式
parent
132599f0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
25 deletions
+33
-25
node.js
src/core/node.js
+32
-5
history.js
src/module/history.js
+1
-20
No files found.
src/core/node.js
View file @
50d3aa4b
...
@@ -255,22 +255,49 @@ var MinderNode = KityMinder.MinderNode = kity.createClass('MinderNode', {
...
@@ -255,22 +255,49 @@ var MinderNode = KityMinder.MinderNode = kity.createClass('MinderNode', {
return
cloneNode
(
null
,
this
);
return
cloneNode
(
null
,
this
);
},
},
equals
:
function
(
node
)
{
equals
:
function
(
node
,
ignoreSelected
)
{
var
me
=
this
;
function
restoreSelected
(){
if
(
isSelectedA
){
me
.
setSelectedFlag
();
}
if
(
isSelectedB
){
node
.
setSelectedFlag
();
}
}
if
(
ignoreSelected
){
var
isSelectedA
=
false
;
var
isSelectedB
=
false
;
if
(
me
.
isSelected
()){
isSelectedA
=
true
;
me
.
clearSelectedFlag
();
}
if
(
node
.
isSelected
()){
isSelectedB
=
true
;
node
.
clearSelectedFlag
();
}
}
if
(
node
.
children
.
length
!=
this
.
children
.
length
)
{
if
(
node
.
children
.
length
!=
this
.
children
.
length
)
{
restoreSelected
();
return
false
;
return
false
;
}
}
if
(
utils
.
compareObject
(
node
.
getData
(),
this
.
getData
())
===
false
)
{
if
(
utils
.
compareObject
(
node
.
getData
(),
me
.
getData
())
===
false
)
{
restoreSelected
();
return
false
;
return
false
;
}
}
if
(
utils
.
compareObject
(
node
.
getTmpData
(),
this
.
getTmpData
())
===
false
)
{
if
(
utils
.
compareObject
(
node
.
getTmpData
(),
me
.
getTmpData
())
===
false
)
{
restoreSelected
();
return
false
;
return
false
;
}
}
for
(
var
i
=
0
,
ci
;
for
(
var
i
=
0
,
ci
;
(
ci
=
this
.
children
[
i
]);
i
++
)
{
(
ci
=
me
.
children
[
i
]);
i
++
)
{
if
(
ci
.
equals
(
node
.
children
[
i
])
===
false
)
{
if
(
ci
.
equals
(
node
.
children
[
i
],
ignoreSelected
)
===
false
)
{
restoreSelected
();
return
false
;
return
false
;
}
}
}
}
restoreSelected
();
return
true
;
return
true
;
},
},
...
...
src/module/history.js
View file @
50d3aa4b
...
@@ -14,27 +14,8 @@ KityMinder.registerModule("HistoryModule", function() {
...
@@ -14,27 +14,8 @@ KityMinder.registerModule("HistoryModule", function() {
return
this
.
getData
().
clone
();
return
this
.
getData
().
clone
();
},
},
equals
:
function
(
scene
)
{
equals
:
function
(
scene
)
{
var
nodeA
=
scene
.
getData
(),
isSelectedA
=
false
;
return
this
.
getData
().
equals
(
scene
.
getData
());
var
nodeB
=
this
.
getData
(),
isSelectedB
=
false
;
if
(
nodeA
.
isSelected
()){
isSelectedA
=
true
;
nodeA
.
clearSelectedFlag
();
}
if
(
nodeB
.
isSelected
()){
isSelectedB
=
true
;
nodeB
.
clearSelectedFlag
();
}
var
result
=
nodeB
.
equals
(
nodeA
);
if
(
isSelectedA
){
nodeA
.
setSelectedFlag
();
}
if
(
isSelectedB
){
nodeB
.
setSelectedFlag
();
}
return
result
;
},
},
isInputStatus
:
function
(){
isInputStatus
:
function
(){
return
this
.
inputStatus
;
return
this
.
inputStatus
;
...
...
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