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
decae12f
Commit
decae12f
authored
May 14, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加超链接点击范围
parent
75362bd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
11 deletions
+21
-11
hyperlink.js
src/module/hyperlink.js
+21
-11
No files found.
src/module/hyperlink.js
View file @
decae12f
...
...
@@ -9,14 +9,14 @@ KityMinder.registerModule( "hyperlink", function () {
var
nodes
=
km
.
getSelectedNodes
();
utils
.
each
(
nodes
,
function
(
i
,
n
)
{
n
.
setData
(
'hyperlink'
,
url
);
km
.
updateLayout
(
n
)
}
)
km
.
updateLayout
(
n
)
;
}
)
;
},
queryState
:
function
(
km
)
{
var
nodes
=
km
.
getSelectedNodes
(),
result
=
0
;
if
(
nodes
.
length
==
0
)
{
if
(
nodes
.
length
==
=
0
)
{
return
-
1
;
}
utils
.
each
(
nodes
,
function
(
i
,
n
)
{
...
...
@@ -39,13 +39,13 @@ KityMinder.registerModule( "hyperlink", function () {
var
nodes
=
km
.
getSelectedNodes
();
utils
.
each
(
nodes
,
function
(
i
,
n
)
{
n
.
setData
(
'hyperlink'
);
km
.
updateLayout
(
n
)
}
)
km
.
updateLayout
(
n
)
;
}
)
;
},
queryState
:
function
(
km
)
{
var
nodes
=
km
.
getSelectedNodes
();
if
(
nodes
.
length
==
0
)
{
if
(
nodes
.
length
==
=
0
)
{
return
-
1
;
}
var
link
=
false
;
...
...
@@ -56,7 +56,7 @@ KityMinder.registerModule( "hyperlink", function () {
}
}
);
if
(
link
)
{
return
0
return
0
;
}
return
-
1
;
}
...
...
@@ -65,17 +65,27 @@ KityMinder.registerModule( "hyperlink", function () {
"events"
:
{
"RenderNodeRight"
:
function
(
e
)
{
var
node
=
e
.
node
,
url
;
if
(
url
=
node
.
getData
(
'hyperlink'
)
)
{
url
=
node
.
getData
(
'hyperlink'
)
;
if
(
url
)
{
var
link
=
new
kity
.
HyperLink
(
url
);
var
linkshape
=
new
kity
.
Path
();
var
outline
=
new
kity
.
Rect
(
24
,
22
,
-
2
,
-
6
,
4
).
fill
(
'rgba(255, 255, 255, 0)'
);
var
box
=
node
.
getContRc
().
getBoundaryBox
();
var
style
=
this
.
getCurrentLayoutStyle
()[
node
.
getType
()
];
linkshape
.
setPathData
(
linkShapePath
).
fill
(
'#666'
).
setTranslate
(
box
.
x
+
box
.
width
+
style
.
spaceLeft
,
-
5
);
linkshape
.
setPathData
(
linkShapePath
).
fill
(
'#666'
);
link
.
setAttr
(
'xlink:title'
,
url
);
link
.
addShape
(
outline
);
link
.
addShape
(
linkshape
);
link
.
setTarget
(
'_blank'
);
link
.
setStyle
(
'cursor'
,
'pointer'
);
node
.
getContRc
().
addShape
(
link
);
node
.
getContRc
().
addShape
(
link
.
setTranslate
(
box
.
x
+
box
.
width
+
style
.
spaceLeft
+
5
,
-
5
)
);
link
.
on
(
'mouseover'
,
function
()
{
outline
.
fill
(
'rgba(255, 255, 200, .8)'
);
}).
on
(
'mouseout'
,
function
()
{
outline
.
fill
(
'rgba(255, 255, 255, 0)'
);
});
}
}
...
...
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