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
163c528d
Commit
163c528d
authored
Dec 23, 2013
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename cancel to stopPropagation
parent
8b7c0bfa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
19 deletions
+19
-19
kityminder.js
src/core/kityminder.js
+8
-8
minderevent.js
src/core/minderevent.js
+11
-11
No files found.
src/core/kityminder.js
View file @
163c528d
...
...
@@ -86,9 +86,9 @@ kity.extendClass( KityMinder, ( function () {
commandArgs
:
cmdArgs
};
var
cancel
ed
=
me
.
_fire
(
new
MinderEvent
(
'beforecommand'
,
eventParams
,
true
)
);
var
stop
ed
=
me
.
_fire
(
new
MinderEvent
(
'beforecommand'
,
eventParams
,
true
)
);
if
(
!
cancel
ed
)
{
if
(
!
stop
ed
)
{
me
.
_fire
(
new
MinderEvent
(
"precommand"
,
eventParams
,
false
)
);
...
...
@@ -213,8 +213,8 @@ kity.extendClass( KityMinder, {
var
minder
=
this
;
clearTimeout
(
this
.
interactTimeout
);
this
.
interactTimeout
=
setTimeout
(
function
()
{
var
cancel
ed
=
minder
.
_fire
(
new
MinderEvent
(
'beforeinteractchange'
)
);
if
(
cancel
ed
)
{
var
stop
ed
=
minder
.
_fire
(
new
MinderEvent
(
'beforeinteractchange'
)
);
if
(
stop
ed
)
{
return
;
}
minder
.
_fire
(
new
MinderEvent
(
'preinteractchange'
)
);
...
...
@@ -232,11 +232,11 @@ kity.extendClass( KityMinder, {
}
for
(
var
i
=
0
;
i
<
callbacks
.
length
;
i
++
)
{
callbacks
[
i
].
call
(
this
,
e
);
if
(
e
.
should
Cancel
Immediately
()
)
{
if
(
e
.
should
StopPropagation
Immediately
()
)
{
break
;
}
}
return
e
.
should
Cancel
();
return
e
.
should
StopPropagation
();
},
on
:
function
(
name
,
callback
)
{
var
types
=
name
.
split
(
' '
);
...
...
@@ -307,9 +307,9 @@ kity.extendClass( KityMinder, {
importData
:
treeData
};
var
cancel
ed
=
this
.
_fire
(
new
MinderEvent
(
'beforeimport'
,
params
,
true
)
);
var
stop
ed
=
this
.
_fire
(
new
MinderEvent
(
'beforeimport'
,
params
,
true
)
);
if
(
cancel
ed
)
return
this
;
if
(
stop
ed
)
return
this
;
this
.
_fire
(
new
MinderEvent
(
'preimport'
,
params
,
false
)
);
...
...
src/core/minderevent.js
View file @
163c528d
var
MinderEvent
=
kity
.
createClass
(
'MindEvent'
,
{
constructor
:
function
(
type
,
params
,
can
celable
)
{
constructor
:
function
(
type
,
params
,
can
stop
)
{
params
=
params
||
{};
if
(
params
.
getType
&&
params
.
getType
()
==
'ShapeEvent'
)
{
this
.
kityEvent
=
params
;
...
...
@@ -8,7 +8,7 @@ var MinderEvent = kity.createClass( 'MindEvent', {
kity
.
Utils
.
extend
(
this
,
params
);
}
this
.
type
=
type
;
this
.
_can
celable
=
cancelable
||
false
;
this
.
_can
stop
=
canstop
||
false
;
if
(
params
.
targetShape
)
{
this
.
getTargetNode
=
function
()
{
var
findShape
=
params
.
targetShape
;
...
...
@@ -20,20 +20,20 @@ var MinderEvent = kity.createClass( 'MindEvent', {
}
},
cancel
:
function
()
{
this
.
_
cancel
ed
=
true
;
stopPropagation
:
function
()
{
this
.
_
stop
ed
=
true
;
},
cancel
Immediately
:
function
()
{
this
.
_immediately
Cancel
d
=
true
;
this
.
_
cancel
ed
=
true
;
stopPropagation
Immediately
:
function
()
{
this
.
_immediately
Stope
d
=
true
;
this
.
_
stop
ed
=
true
;
},
should
Cancel
:
function
()
{
return
this
.
_can
celable
&&
this
.
_cancel
ed
;
should
StopPropagation
:
function
()
{
return
this
.
_can
stop
&&
this
.
_stop
ed
;
},
should
Cancel
Immediately
:
function
()
{
return
this
.
_can
celable
&&
this
.
_immediatelyCancel
d
;
should
StopPropagation
Immediately
:
function
()
{
return
this
.
_can
stop
&&
this
.
_immediatelyStope
d
;
}
}
);
\ No newline at end of file
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