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
2c4bd20a
Commit
2c4bd20a
authored
Jan 24, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了select功能
parent
1a6a1dce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
41 deletions
+39
-41
minder.select.js
src/core/minder.select.js
+4
-7
editor.js
src/module/editor.js
+33
-32
layout.js
src/module/layout.js
+2
-2
No files found.
src/core/minder.select.js
View file @
2c4bd20a
...
@@ -31,20 +31,17 @@ kity.extendClass( Minder, function () {
...
@@ -31,20 +31,17 @@ kity.extendClass( Minder, function () {
}
);
}
);
this
.
_selectedNodes
=
[];
this
.
_selectedNodes
=
[];
},
},
select
:
function
(
nodes
)
{
select
:
function
(
nodes
,
isToggleSelect
)
{
this
.
removeAllSelectedNodes
();
isToggleSelect
&&
this
.
removeAllSelectedNodes
();
var
me
=
this
;
var
me
=
this
;
Utils
.
each
(
Utils
.
isArray
(
nodes
)
?
nodes
:
[
nodes
],
function
(
i
,
n
)
{
Utils
.
each
(
Utils
.
isArray
(
nodes
)
?
nodes
:
[
nodes
],
function
(
i
,
n
)
{
if
(
me
.
_selectedNodes
.
indexOf
(
n
)
!==
-
1
)
return
;
me
.
_selectedNodes
.
push
(
n
);
me
.
_selectedNodes
.
push
(
n
);
highlightNode
(
me
,
n
);
highlightNode
(
me
,
n
);
}
);
}
);
return
this
;
return
this
;
},
},
addSelect
:
function
(
node
)
{
var
me
=
this
;
if
(
me
.
_selectedNodes
.
indexOf
(
node
)
===
-
1
)
me
.
_selectedNodes
.
push
(
node
);
highlightNode
(
me
,
node
);
},
isNodeSelected
:
function
(
node
)
{
isNodeSelected
:
function
(
node
)
{
return
node
.
getData
(
'highlight'
)
===
true
;
return
node
.
getData
(
'highlight'
)
===
true
;
},
},
...
...
src/module/editor.js
View file @
2c4bd20a
...
@@ -10,44 +10,45 @@ KityMinder.registerModule( "TextEditModule", function () {
...
@@ -10,44 +10,45 @@ KityMinder.registerModule( "TextEditModule", function () {
this
.
getPaper
().
addShape
(
cursor
);
this
.
getPaper
().
addShape
(
cursor
);
},
},
"events"
:
{
"events"
:
{
'aftermousedown'
:
function
(
e
){
'beforemousedown'
:
function
(
e
){
if
(
this
.
isSingleSelect
()){
//
debugger
// if(this.isSingleSelect()){
var
node
=
this
.
getSelectedNode
();
// console.log('isSelect')
var
node_rc
=
node
.
getRenderContainer
();
// var node = this.getSelectedNode();
var
position
=
e
.
getPosition
();
// var node_rc = node.getRenderContainer();
if
(
node_rc
.
getType
()
!=
'Text'
){
// var position = e.getPosition();
var
offset
=
e
.
getPosition
();
// if(node_rc.getType() != 'Text'){
cursor
.
setShow
().
setPosition
(
offset
);
// var offset = e.getPosition();
// receiver.clear()
// cursor.setShow().setPosition(offset);
// .setTextShape()
//// receiver.clear()
// .setTextShapeSize(cursor.height)
//// .setTextShape()
// .appendTextShapeToPaper(this.getPaper())
//// .setTextShapeSize(cursor.height)
// .setPosition(position)
//// .appendTextShapeToPaper(this.getPaper())
// .setRange(range,0)
//// .setPosition(position)
// .setCursor(cursor)
//// .setRange(range,0)
receiver
.
setCursor
(
cursor
)
//// .setCursor(cursor)
.
setKityMinder
(
this
)
.
setMinderNode
(
node
)
.
setTextShape
(
node_rc
)
.
setCursorHeight
()
.
setCurrentIndex
(
position
)
.
updateCursor
()
.
setRange
(
range
,
0
);
}
else
{
// receiver.setCursor(cursor)
// receiver.setCursor(cursor)
// .setKityMinder(this)
// .setKityMinder(this)
// .setMinderNode(
e.getTargetNode()
)
// .setMinderNode(
node
)
// .setTextShape(node_rc)
// .setTextShape(node_rc)
// .setCursorHeight()
// .setCursorHeight()
// .setCurrentIndex(position)
// .setCurrentIndex(position)
// .updateCursor()
// .updateCursor()
// .setRange(range);
// .setRange(range,0);
// }else{
}
//
}
//
//// receiver.setCursor(cursor)
//// .setKityMinder(this)
//// .setMinderNode(e.getTargetNode())
//// .setTextShape(node_rc)
//// .setCursorHeight()
//// .setCurrentIndex(position)
//// .updateCursor()
//// .setRange(range);
//
// }
// }
}
}
}
}
...
...
src/module/layout.js
View file @
2c4bd20a
...
@@ -85,7 +85,7 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -85,7 +85,7 @@ KityMinder.registerModule( "LayoutModule", function () {
execute
:
function
(
km
,
node
)
{
execute
:
function
(
km
,
node
)
{
var
parent
=
km
.
getSelectedNode
();
var
parent
=
km
.
getSelectedNode
();
km
.
appendChildNode
(
parent
,
node
);
km
.
appendChildNode
(
parent
,
node
);
km
.
select
(
node
);
km
.
select
(
node
,
true
);
return
node
;
return
node
;
}
}
};
};
...
@@ -100,7 +100,7 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -100,7 +100,7 @@ KityMinder.registerModule( "LayoutModule", function () {
}
else
{
}
else
{
km
.
appendSiblingNode
(
selectedNode
,
node
);
km
.
appendSiblingNode
(
selectedNode
,
node
);
}
}
km
.
select
(
node
);
km
.
select
(
node
,
true
);
return
node
;
return
node
;
}
}
};
};
...
...
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