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
c3e1e305
Commit
c3e1e305
authored
Jul 24, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix drag issue
parent
dffc0887
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
89 additions
and
64 deletions
+89
-64
index.html
dist/index.html
+11
-11
kityminder.all.js
dist/kityminder.all.js
+41
-26
kityminder.all.min.js
dist/kityminder.all.min.js
+4
-4
minder.js
src/core/minder.js
+22
-13
dragtree.js
src/module/dragtree.js
+10
-9
expand.js
src/module/expand.js
+1
-1
No files found.
dist/index.html
View file @
c3e1e305
...
...
@@ -7,26 +7,26 @@
<meta
name=
"description"
content=
"百度脑图,便捷的脑图编辑工具。让您在线上直接创建、保存并分享你的思路。"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, user-scalable=no"
>
<script
src=
"lib/jquery-2.1.0.min.js?_=14061
87190589
"
charset=
"utf-8"
></script>
<script
src=
"lib/ZeroClipboard.min.js?_=14061
87190589
"
charset=
"utf-8"
></script>
<script
src=
"lib/jquery-2.1.0.min.js?_=14061
93886421
"
charset=
"utf-8"
></script>
<script
src=
"lib/ZeroClipboard.min.js?_=14061
93886421
"
charset=
"utf-8"
></script>
<script
type=
"text/javascript"
>
ZeroClipboard
.
setDefaults
(
{
moviePath
:
'lib/ZeroClipboard.swf'
}
);
</script>
<script
src=
"lib/kity.min.js?_=14061
87190589
"
charset=
"utf-8"
></script>
<script
src=
"kityminder.all.min.js?_=14061
87190589
"
charset=
"utf-8"
></script>
<script
src=
"kityminder.config.js?_=14061
87190589
"
charset=
"utf-8"
></script>
<script
src=
"lang/zh-cn/zh-cn.js?_=14061
87190589
"
charset=
"utf-8"
></script>
<script
src=
"lib/kity.min.js?_=14061
93886421
"
charset=
"utf-8"
></script>
<script
src=
"kityminder.all.min.js?_=14061
93886421
"
charset=
"utf-8"
></script>
<script
src=
"kityminder.config.js?_=14061
93886421
"
charset=
"utf-8"
></script>
<script
src=
"lang/zh-cn/zh-cn.js?_=14061
93886421
"
charset=
"utf-8"
></script>
<script
src=
"lib/zip.js?_=14061
87190589
"
charset=
"utf-8"
></script>
<script
src=
"lib/zip.js?_=14061
93886421
"
charset=
"utf-8"
></script>
<script>
zip
.
inflateJSPath
=
'lib/inflate.js'
;
</script>
<script
src=
"lib/jquery.xml2json.js?_=14061
87190589
"
charset=
"utf-8"
></script>
<script
src=
"lib/baidu-frontia-js-full-1.0.0.js?_=14061
87190589
"
charset=
"utf-8"
></script>
<script
src=
"social/draftmanager.js?_=14061
87190589
"
charset=
"utf-8"
></script>
<script
src=
"social/social.js?_=14061
87190589
"
charset=
"utf-8"
></script>
<script
src=
"lib/jquery.xml2json.js?_=14061
93886421
"
charset=
"utf-8"
></script>
<script
src=
"lib/baidu-frontia-js-full-1.0.0.js?_=14061
93886421
"
charset=
"utf-8"
></script>
<script
src=
"social/draftmanager.js?_=14061
93886421
"
charset=
"utf-8"
></script>
<script
src=
"social/social.js?_=14061
93886421
"
charset=
"utf-8"
></script>
<link
href=
"social/social.css"
rel=
"stylesheet"
>
<link
href=
"themes/default/css/import.css"
type=
"text/css"
rel=
"stylesheet"
/>
...
...
dist/kityminder.all.js
View file @
c3e1e305
...
...
@@ -988,19 +988,28 @@ var Minder = KityMinder.Minder = kity.createClass('KityMinder', {
this
.
_status
=
'normal'
;
this
.
_rollbackStatus
=
'normal'
;
},
setStatus
:
function
(
status
)
{
if
(
status
!=
this
.
_status
)
{
this
.
fire
(
'statuschange'
,{
lastStatus
:
this
.
_status
,
currentStatus
:
status
});
// console.log(window.event.type, this._status, '->', status);
// console.trace();
this
.
_rollbackStatus
=
this
.
_status
;
this
.
_status
=
status
;
}
return
this
;
},
setStatus
:
(
function
()
{
var
sf
=
~
window
.
location
.
href
.
indexOf
(
'status'
);
var
tf
=
~
window
.
location
.
href
.
indexOf
(
'trace'
);
return
function
(
status
)
{
if
(
status
!=
this
.
_status
)
{
this
.
_rollbackStatus
=
this
.
_status
;
this
.
_status
=
status
;
this
.
fire
(
'statuschange'
,
{
lastStatus
:
this
.
_rollbackStatus
,
currentStatus
:
this
.
_status
});
if
(
sf
)
{
console
.
log
(
window
.
event
.
type
,
this
.
_rollbackStatus
,
'->'
,
this
.
_status
);
if
(
tf
)
{
console
.
trace
();
}
}
}
return
this
;
};
})(),
rollbackStatus
:
function
()
{
this
.
setStatus
(
this
.
_rollbackStatus
);
},
...
...
@@ -4219,7 +4228,7 @@ KityMinder.registerModule('Expand', function() {
if
(
this
.
getStatus
()
==
'textedit'
)
return
;
if
(
e
.
originEvent
.
keyCode
==
keymap
[
'/'
])
{
var
node
=
this
.
getSelectedNode
();
if
(
!
node
)
return
;
if
(
!
node
||
node
==
this
.
getRoot
()
)
return
;
var
expanded
=
node
.
isExpanded
();
this
.
getSelectedNodes
().
forEach
(
function
(
node
)
{
if
(
expanded
)
node
.
collapse
();
...
...
@@ -5714,6 +5723,9 @@ var TreeDragger = kity.createClass('TreeDragger', {
if
(
!
this
.
_dragMode
)
{
return
;
}
this
.
_fadeDragSources
(
1
);
if
(
this
.
_dropSucceedTarget
)
{
this
.
_dragSources
.
forEach
(
function
(
source
)
{
...
...
@@ -5763,6 +5775,7 @@ var TreeDragger = kity.createClass('TreeDragger', {
this
.
_calcDropTargets
();
this
.
_calcOrderHints
();
this
.
_dragMode
=
true
;
this
.
_minder
.
setStatus
(
'dragtree'
);
return
true
;
},
...
...
@@ -5786,14 +5799,12 @@ var TreeDragger = kity.createClass('TreeDragger', {
this
.
_dragSources
.
forEach
(
function
(
source
)
{
source
.
getRenderContainer
().
fxOpacity
(
opacity
,
200
);
source
.
traverse
(
function
(
node
)
{
if
(
opacity
<
1
)
minder
.
detachNode
(
node
);
else
minder
.
attachNode
(
node
);
if
(
opacity
<
1
)
{
minder
.
detachNode
(
node
);
}
else
{
minder
.
attachNode
(
node
);
}
},
true
);
if
(
opacity
<
1
)
{
minder
.
removeConnect
(
source
);
}
else
{
minder
.
createConnect
(
source
);
}
});
},
...
...
@@ -5851,12 +5862,12 @@ var TreeDragger = kity.createClass('TreeDragger', {
},
_leaveDragMode
:
function
()
{
this
.
_fadeDragSources
(
1
);
this
.
_dragMode
=
false
;
this
.
_dropSucceedTarget
=
null
;
this
.
_orderSucceedHint
=
null
;
this
.
_renderDropHint
(
null
);
this
.
_renderOrderHint
(
null
);
this
.
_minder
.
rollbackStatus
();
},
_drawForDragMode
:
function
()
{
...
...
@@ -5938,6 +5949,9 @@ KityMinder.registerModule('DragTree', function() {
return
{
init
:
function
()
{
dragger
=
new
TreeDragger
(
this
);
window
.
addEventListener
(
'mouseup'
,
function
()
{
dragger
.
dragEnd
();
});
},
events
:
{
'normal.mousedown inputready.mousedown'
:
function
(
e
)
{
...
...
@@ -5947,12 +5961,13 @@ KityMinder.registerModule('DragTree', function() {
dragger
.
dragStart
(
e
.
getPosition
(
this
.
getRenderContainer
()));
}
},
'normal.mousemove'
:
function
(
e
)
{
'normal.mousemove
dragtree.mousemove
'
:
function
(
e
)
{
dragger
.
dragMove
(
e
.
getPosition
(
this
.
getRenderContainer
()));
},
'normal.mouseup'
:
function
(
e
)
{
dragger
.
dragEnd
(
e
.
getPosition
(
this
.
getRenderContainer
()));
e
.
stopPropagation
();
'normal.mouseup dragtree.beforemouseup'
:
function
(
e
)
{
dragger
.
dragEnd
();
//e.stopPropagation();
e
.
preventDefault
();
this
.
fire
(
'contentchange'
);
},
'statuschange'
:
function
(
e
)
{
...
...
dist/kityminder.all.min.js
View file @
c3e1e305
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/core/minder.js
View file @
c3e1e305
...
...
@@ -175,19 +175,28 @@ var Minder = KityMinder.Minder = kity.createClass('KityMinder', {
this
.
_status
=
'normal'
;
this
.
_rollbackStatus
=
'normal'
;
},
setStatus
:
function
(
status
)
{
if
(
status
!=
this
.
_status
)
{
this
.
fire
(
'statuschange'
,{
lastStatus
:
this
.
_status
,
currentStatus
:
status
});
// console.log(window.event.type, this._status, '->', status);
// console.trace();
this
.
_rollbackStatus
=
this
.
_status
;
this
.
_status
=
status
;
}
return
this
;
},
setStatus
:
(
function
()
{
var
sf
=
~
window
.
location
.
href
.
indexOf
(
'status'
);
var
tf
=
~
window
.
location
.
href
.
indexOf
(
'trace'
);
return
function
(
status
)
{
if
(
status
!=
this
.
_status
)
{
this
.
_rollbackStatus
=
this
.
_status
;
this
.
_status
=
status
;
this
.
fire
(
'statuschange'
,
{
lastStatus
:
this
.
_rollbackStatus
,
currentStatus
:
this
.
_status
});
if
(
sf
)
{
console
.
log
(
window
.
event
.
type
,
this
.
_rollbackStatus
,
'->'
,
this
.
_status
);
if
(
tf
)
{
console
.
trace
();
}
}
}
return
this
;
};
})(),
rollbackStatus
:
function
()
{
this
.
setStatus
(
this
.
_rollbackStatus
);
},
...
...
src/module/dragtree.js
View file @
c3e1e305
...
...
@@ -175,6 +175,7 @@ var TreeDragger = kity.createClass('TreeDragger', {
this
.
_calcDropTargets
();
this
.
_calcOrderHints
();
this
.
_dragMode
=
true
;
this
.
_minder
.
setStatus
(
'dragtree'
);
return
true
;
},
...
...
@@ -204,11 +205,6 @@ var TreeDragger = kity.createClass('TreeDragger', {
minder
.
attachNode
(
node
);
}
},
true
);
if
(
opacity
<
1
)
{
minder
.
removeConnect
(
source
);
}
else
{
minder
.
createConnect
(
source
);
}
});
},
...
...
@@ -271,6 +267,7 @@ var TreeDragger = kity.createClass('TreeDragger', {
this
.
_orderSucceedHint
=
null
;
this
.
_renderDropHint
(
null
);
this
.
_renderOrderHint
(
null
);
this
.
_minder
.
rollbackStatus
();
},
_drawForDragMode
:
function
()
{
...
...
@@ -352,6 +349,9 @@ KityMinder.registerModule('DragTree', function() {
return
{
init
:
function
()
{
dragger
=
new
TreeDragger
(
this
);
window
.
addEventListener
(
'mouseup'
,
function
()
{
dragger
.
dragEnd
();
});
},
events
:
{
'normal.mousedown inputready.mousedown'
:
function
(
e
)
{
...
...
@@ -361,12 +361,13 @@ KityMinder.registerModule('DragTree', function() {
dragger
.
dragStart
(
e
.
getPosition
(
this
.
getRenderContainer
()));
}
},
'normal.mousemove'
:
function
(
e
)
{
'normal.mousemove
dragtree.mousemove
'
:
function
(
e
)
{
dragger
.
dragMove
(
e
.
getPosition
(
this
.
getRenderContainer
()));
},
'normal.mouseup'
:
function
(
e
)
{
dragger
.
dragEnd
(
e
.
getPosition
(
this
.
getRenderContainer
()));
e
.
stopPropagation
();
'normal.mouseup dragtree.beforemouseup'
:
function
(
e
)
{
dragger
.
dragEnd
();
//e.stopPropagation();
e
.
preventDefault
();
this
.
fire
(
'contentchange'
);
},
'statuschange'
:
function
(
e
)
{
...
...
src/module/expand.js
View file @
c3e1e305
...
...
@@ -233,7 +233,7 @@ KityMinder.registerModule('Expand', function() {
if
(
this
.
getStatus
()
==
'textedit'
)
return
;
if
(
e
.
originEvent
.
keyCode
==
keymap
[
'/'
])
{
var
node
=
this
.
getSelectedNode
();
if
(
!
node
)
return
;
if
(
!
node
||
node
==
this
.
getRoot
()
)
return
;
var
expanded
=
node
.
isExpanded
();
this
.
getSelectedNodes
().
forEach
(
function
(
node
)
{
if
(
expanded
)
node
.
collapse
();
...
...
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