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
bde47fd0
Commit
bde47fd0
authored
May 08, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
view bug fix
parent
91eb21d3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
29 deletions
+52
-29
kity
kity
+1
-1
social.js
social/social.js
+44
-23
view.js
src/module/view.js
+7
-5
No files found.
kity
@
84b8e320
Subproject commit
afbb101c5b3d7518080bac3886f16043a482b7c9
Subproject commit
84b8e320dc03c3070607d20c7a5f354168d48181
social/social.js
View file @
bde47fd0
...
...
@@ -79,7 +79,7 @@ $( function () {
minder
=
window
.
km
,
// 草稿箱实例
draftManager
=
window
.
draftManager
||
(
window
.
draftManager
=
new
window
.
DraftManager
(
minder
)
)
,
draftManager
,
// 当前是否要检测文档内容是否变化的开关
watchingChanges
=
true
,
...
...
@@ -99,8 +99,8 @@ $( function () {
loadShare
();
bindShortCuts
();
bindDraft
();
watchChanges
();
if
(
!
loadPath
()
&&
!
isShareLink
)
loadDraft
(
0
);
draftManager
&&
watchChanges
();
if
(
draftManager
&&
!
loadPath
()
&&
!
isShareLink
)
loadDraft
(
0
);
}
// 创建 UI
...
...
@@ -159,6 +159,7 @@ $( function () {
},
30
);
}
);
if
(
window
.
ZeroClipboard
)
{
var
clip
=
new
window
.
ZeroClipboard
(
$copy_url_btn
,
{
hoverClass
:
'hover'
,
activeClass
:
'active'
...
...
@@ -168,6 +169,7 @@ $( function () {
clearTimeout
(
copyTrickTimer
);
}
);
}
}
// 初始化云平台 frontia
function
initFrontia
()
{
...
...
@@ -207,6 +209,8 @@ $( function () {
$share_btn
.
loading
(
false
);
return
notice
(
'加载分享内容失败!请确认分享链接正确。'
);
}
if
(
draftManager
)
{
var
draft
=
draftManager
.
openByPath
(
'share/'
+
shareId
);
if
(
draft
)
{
draftManager
.
load
();
...
...
@@ -214,6 +218,9 @@ $( function () {
draftManager
.
create
(
'share/'
+
shareId
);
minder
.
importData
(
ret
.
result
[
0
].
obj
.
shareMinder
.
data
,
'json'
);
}
}
else
{
minder
.
importData
(
ret
.
result
[
0
].
obj
.
shareMinder
.
data
,
'json'
);
}
setRemotePath
(
null
,
false
);
$share_btn
.
loading
(
false
);
},
...
...
@@ -537,11 +544,14 @@ $( function () {
minder
.
importData
(
data
,
format
);
if
(
draftManager
)
{
if
(
!
draftManager
.
openByPath
(
remotePath
)
)
{
draftManager
.
create
();
}
draftManager
.
save
(
remotePath
);
draftManager
.
sync
();
}
minder
.
execCommand
(
'camera'
,
minder
.
getRoot
()
);
$user_btn
.
loading
(
false
).
text
(
getFileName
(
remotePath
)
);
...
...
@@ -570,13 +580,13 @@ $( function () {
// 点击文件菜单
function
openFile
(
e
)
{
var
path
=
$
(
this
).
data
(
'value'
);
var
draft
=
draftManager
.
getCurrent
();
var
draft
=
draftManager
&&
draftManager
.
getCurrent
();
if
(
draft
&&
draft
.
path
==
path
)
{
if
(
!
draft
.
sync
&&
window
.
confirm
(
'“'
+
getFileName
(
path
)
+
'”在草稿箱包含未保存的更改,确定加载网盘版本覆盖草稿箱中的版本吗?'
)
)
{
setRemotePath
(
path
,
true
);
loadRemote
();
}
}
else
{
}
else
if
(
draftManager
)
{
draft
=
draftManager
.
openByPath
(
path
);
setRemotePath
(
path
,
!
draft
||
draft
.
sync
);
if
(
draft
)
{
...
...
@@ -586,6 +596,9 @@ $( function () {
}
else
{
loadRemote
();
}
}
else
{
setRemotePath
(
path
,
true
);
loadRemote
();
}
}
...
...
@@ -625,8 +638,10 @@ $( function () {
addToRecentMenu
(
[
savedFile
]
);
}
setRemotePath
(
savedFile
.
path
,
true
);
if
(
draftManager
)
{
draftManager
.
save
(
remotePath
);
draftManager
.
sync
();
}
clearTimeout
(
timeout
);
}
else
{
error
(
'保存到云盘失败,可能是网络问题导致!'
);
...
...
@@ -751,6 +766,12 @@ $( function () {
}
function
bindDraft
()
{
if
(
!
draftManager
)
{
if
(
window
.
DraftManager
)
{
draftManager
=
new
window
.
DraftManager
(
minder
);
}
}
$draft_menu
.
delegate
(
'a.delete'
,
'click'
,
function
(
e
)
{
var
$li
=
$
(
this
).
closest
(
'li.draft-item'
);
draftManager
.
remove
(
+
$li
.
data
(
'draft-index'
)
);
...
...
src/module/view.js
View file @
bde47fd0
...
...
@@ -27,13 +27,14 @@ var ViewDragger = kity.createClass( "ViewDragger", {
lastPosition
=
null
,
currentPosition
=
null
;
this
.
_minder
.
on
(
'normal.beforemousedown readonly.beforemousedown'
,
function
(
e
)
{
this
.
_minder
.
on
(
'normal.beforemousedown readonly.beforemousedown
readonly.beforetouchstart
'
,
function
(
e
)
{
// 点击未选中的根节点临时开启
if
(
e
.
getTargetNode
()
==
this
.
getRoot
()
&&
(
!
this
.
getRoot
().
isSelected
()
||
!
this
.
isSingleSelect
()
)
)
{
lastPosition
=
e
.
getPosition
();
dragger
.
setEnabled
(
true
);
isRootDrag
=
true
;
e
.
originEvent
.
preventDefault
();
var
me
=
this
;
setTimeout
(
function
()
{
me
.
setStatus
(
'hand'
);
...
...
@@ -41,16 +42,15 @@ var ViewDragger = kity.createClass( "ViewDragger", {
}
}
)
.
on
(
'hand.beforemousedown'
,
function
(
e
)
{
.
on
(
'hand.beforemousedown
hand.beforetouchend
'
,
function
(
e
)
{
// 已经被用户打开拖放模式
if
(
dragger
.
isEnabled
()
)
{
lastPosition
=
e
.
getPosition
();
e
.
stopPropagation
();
e
.
originEvent
.
preventDefault
();
}
}
)
.
on
(
'hand.beforemousemove'
,
function
(
e
)
{
.
on
(
'hand.beforemousemove
hand.beforetouchmove
'
,
function
(
e
)
{
if
(
lastPosition
)
{
currentPosition
=
e
.
getPosition
();
...
...
@@ -58,6 +58,8 @@ var ViewDragger = kity.createClass( "ViewDragger", {
var
offset
=
kity
.
Vector
.
fromPoints
(
lastPosition
,
currentPosition
);
dragger
.
move
(
offset
);
e
.
stopPropagation
();
e
.
preventDefault
();
e
.
originEvent
.
preventDefault
();
lastPosition
=
currentPosition
;
}
}
)
...
...
@@ -102,7 +104,7 @@ KityMinder.registerModule( 'View', function () {
base
:
Command
,
execute
:
function
(
km
,
focusNode
)
{
var
viewport
=
km
.
getPaper
().
getViewPort
();
var
offset
=
focusNode
.
getRenderContainer
().
getRenderBox
(
'
paper
'
);
var
offset
=
focusNode
.
getRenderContainer
().
getRenderBox
(
'
view
'
);
var
dx
=
viewport
.
center
.
x
-
offset
.
x
-
offset
.
width
/
2
,
dy
=
viewport
.
center
.
y
-
offset
.
y
;
km
.
getRenderContainer
().
fxTranslate
(
dx
,
dy
,
1000
,
"easeOutQuint"
);
...
...
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