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
15202ad1
Commit
15202ad1
authored
May 08, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复编辑节点
parent
91215a80
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
35 deletions
+45
-35
CHANGELOG.md
CHANGELOG.md
+6
-6
contextmenu.js
src/adapter/contextmenu.js
+5
-5
node.js
src/core/node.js
+4
-5
editor.js
src/module/editor.js
+25
-1
editor.receiver.js
src/module/editor.receiver.js
+2
-0
history.js
src/module/history.js
+2
-13
layout.js
src/module/layout.js
+1
-5
No files found.
CHANGELOG.md
View file @
15202ad1
...
@@ -5,16 +5,16 @@
...
@@ -5,16 +5,16 @@
1.
添加保存时可修改文件名
1.
添加保存时可修改文件名
2.
添加超链接功能
2.
添加超链接功能
3.
选中节点时,按F2直接进入文字编辑状态
3.
选中节点时,按F2直接进入文字编辑状态
4.
展开所有收起节点
4.
添加展开收起节点
5.
当前选中的高亮的节点可直接进行文字编辑
###问题修复
##问题修复
1.
修复当滚动鼠标滚轮时,光标不跟着移动的问题
1.
修复当滚动鼠标滚轮时,光标不跟着移动的问题
2.
优化了拖拽节点操作体验
2.
优化了拖拽节点操作体验
3.
修复回退操作后所选节点未回选问题
3.
修复回退操作后所选节点未回选问题
4.
修复回退操作后展开收起的节点没有记录问题
4.
修复回退操作后展开收起的节点没有记录问题
5.
** 选中节点后可直接输入文字**
5.
优化了输入文字时的卡顿效果
6.
优化了输入文字时的卡顿效果
6.
优化了当输入中文时,中文显示位置与光标距离过远的问题
7.
优化了当输入中文时,中文显示位置与光标距离过远的问题
## v1.1.2
## v1.1.2
...
...
src/adapter/contextmenu.js
View file @
15202ad1
...
@@ -28,13 +28,13 @@ KM.registerUI( 'contextmenu', function () {
...
@@ -28,13 +28,13 @@ KM.registerUI( 'contextmenu', function () {
});
});
me
.
$container
.
append
(
$menu
);
me
.
$container
.
append
(
$menu
);
me
.
on
(
'contextmenu'
,
function
(
e
){
me
.
on
(
'contextmenu'
,
function
(
e
){
if
(
this
.
getSelectedNodes
().
length
==
0
){
var
node
=
e
.
getTargetNode
();
var
node
=
e
.
getTargetNode
();
if
(
node
){
if
(
node
){
this
.
removeAllSelectedNodes
();
this
.
select
(
node
);
this
.
select
(
node
)
}
}
}
var
items
=
me
.
getContextmenu
();
var
items
=
me
.
getContextmenu
();
var
data
=
[];
var
data
=
[];
...
...
src/core/node.js
View file @
15202ad1
...
@@ -252,7 +252,7 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
...
@@ -252,7 +252,7 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
},
},
clone
:
function
()
{
clone
:
function
()
{
function
cloneNode
(
parent
,
isClonedNode
,
fn
)
{
function
cloneNode
(
parent
,
isClonedNode
)
{
var
_tmp
=
new
KM
.
MinderNode
(
isClonedNode
.
getText
()
);
var
_tmp
=
new
KM
.
MinderNode
(
isClonedNode
.
getText
()
);
_tmp
.
data
=
Utils
.
clonePlainObject
(
isClonedNode
.
getData
()
);
_tmp
.
data
=
Utils
.
clonePlainObject
(
isClonedNode
.
getData
()
);
...
@@ -264,13 +264,12 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
...
@@ -264,13 +264,12 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
}
}
for
(
var
i
=
0
,
ci
;
for
(
var
i
=
0
,
ci
;
(
ci
=
isClonedNode
.
children
[
i
++
]
);
)
{
(
ci
=
isClonedNode
.
children
[
i
++
]
);
)
{
cloneNode
(
_tmp
,
ci
,
fn
);
cloneNode
(
_tmp
,
ci
);
}
}
fn
&&
fn
(
isClonedNode
,
_tmp
);
return
_tmp
;
return
_tmp
;
}
}
return
function
(
fn
)
{
return
function
()
{
return
cloneNode
(
null
,
this
,
fn
);
return
cloneNode
(
null
,
this
);
};
};
}(),
}(),
equals
:
function
(
node
)
{
equals
:
function
(
node
)
{
...
...
src/module/editor.js
View file @
15202ad1
...
@@ -18,6 +18,30 @@ KityMinder.registerModule( "TextEditModule", function () {
...
@@ -18,6 +18,30 @@ KityMinder.registerModule( "TextEditModule", function () {
return
km
.
receiver
.
isTextEditStatus
();
return
km
.
receiver
.
isTextEditStatus
();
};
};
km
.
textEditNode
=
function
(
node
){
var
textShape
=
node
.
getTextShape
();
this
.
setStatus
(
'textedit'
);
sel
.
setHide
();
sel
.
setStartOffset
(
0
);
sel
.
setEndOffset
(
textShape
.
getContent
().
length
);
receiver
.
setTextEditStatus
(
true
)
.
setSelection
(
sel
)
.
setKityMinder
(
this
)
.
setMinderNode
(
node
)
.
setTextShape
(
textShape
)
.
setRange
(
range
)
.
setBaseOffset
()
.
setContainerStyle
()
.
setSelectionHeight
()
.
setContainerTxt
(
textShape
.
getContent
())
.
updateTextData
()
.
updateSelectionShow
()
.
updateRange
(
range
).
setTextEditStatus
(
true
);
sel
.
setData
(
'relatedNode'
,
node
);
};
var
selectionByClick
=
false
;
var
selectionByClick
=
false
;
var
dragmoveTimer
;
var
dragmoveTimer
;
...
@@ -72,7 +96,7 @@ KityMinder.registerModule( "TextEditModule", function () {
...
@@ -72,7 +96,7 @@ KityMinder.registerModule( "TextEditModule", function () {
sel
.
setShow
();
sel
.
setShow
();
selectionByClick
=
false
;
selectionByClick
=
false
;
}
}
km
.
setStatus
(
'textedit'
)
km
.
setStatus
(
'textedit'
)
;
lastMousedownTimer
=
+
new
Date
;
lastMousedownTimer
=
+
new
Date
;
}
}
}
}
...
...
src/module/editor.receiver.js
View file @
15202ad1
...
@@ -198,9 +198,11 @@ Minder.Receiver = kity.createClass( 'Receiver', {
...
@@ -198,9 +198,11 @@ Minder.Receiver = kity.createClass( 'Receiver', {
updateIndex
:
function
()
{
updateIndex
:
function
()
{
this
.
index
=
this
.
range
.
getStart
().
startOffset
;
this
.
index
=
this
.
range
.
getStart
().
startOffset
;
return
this
;
},
},
updateTextData
:
function
()
{
updateTextData
:
function
()
{
this
.
textShape
.
textData
=
this
.
getTextOffsetData
();
this
.
textShape
.
textData
=
this
.
getTextOffsetData
();
return
this
;
},
},
setSelection
:
function
(
selection
)
{
setSelection
:
function
(
selection
)
{
this
.
selection
=
selection
;
this
.
selection
=
selection
;
...
...
src/module/history.js
View file @
15202ad1
...
@@ -4,24 +4,13 @@ KityMinder.registerModule( "HistoryModule", function () {
...
@@ -4,24 +4,13 @@ KityMinder.registerModule( "HistoryModule", function () {
var
Scene
=
kity
.
createClass
(
'Scene'
,
{
var
Scene
=
kity
.
createClass
(
'Scene'
,
{
constructor
:
function
(
root
)
{
constructor
:
function
(
root
)
{
this
.
data
=
root
.
clone
(
function
(
node
,
cloneNode
)
{
this
.
data
=
root
.
clone
();
km
.
fire
(
'cloneNode'
,
{
'targetNode'
:
cloneNode
,
'sourceNode'
:
node
}
)
}
);
},
},
getData
:
function
()
{
getData
:
function
()
{
return
this
.
data
;
return
this
.
data
;
},
},
cloneData
:
function
()
{
cloneData
:
function
()
{
var
fn
=
function
(
node
,
cloneNode
)
{
return
this
.
getData
().
clone
(
);
km
.
fire
(
'cloneNode'
,
{
'targetNode'
:
cloneNode
,
'sourceNode'
:
node
}
)
};
return
this
.
getData
().
clone
(
fn
);
},
},
equals
:
function
(
scene
)
{
equals
:
function
(
scene
)
{
return
this
.
getData
().
equals
(
scene
.
getData
()
)
return
this
.
getData
().
equals
(
scene
.
getData
()
)
...
...
src/module/layout.js
View file @
15202ad1
...
@@ -210,6 +210,7 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -210,6 +210,7 @@ KityMinder.registerModule( "LayoutModule", function () {
return
null
;
return
null
;
}
}
km
.
select
(
selectedNode
,
true
);
km
.
select
(
selectedNode
,
true
);
km
.
textEditNode
(
selectedNode
);
},
},
queryState
:
function
(
km
)
{
queryState
:
function
(
km
)
{
var
selectedNode
=
km
.
getSelectedNode
();
var
selectedNode
=
km
.
getSelectedNode
();
...
@@ -253,11 +254,6 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -253,11 +254,6 @@ KityMinder.registerModule( "LayoutModule", function () {
},
},
"import"
:
function
(
e
)
{
"import"
:
function
(
e
)
{
this
.
initStyle
();
this
.
initStyle
();
},
"cloneNode"
:
function
(
e
)
{
var
target
=
e
.
targetNode
;
var
source
=
e
.
sourceNode
;
target
.
_layout
=
utils
.
extend
(
{},
source
.
_layout
);
}
}
},
},
'contextmenu'
:
[
{
'contextmenu'
:
[
{
...
...
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