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
1cb8fe62
Commit
1cb8fe62
authored
May 06, 2014
by
campaign
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
Conflicts: import.js
parents
6c6eede3
33e58298
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
63 additions
and
31 deletions
+63
-31
layout.js
src/adapter/layout.js
+16
-16
view.js
src/adapter/view.js
+1
-0
expand.js
src/module/expand.js
+30
-0
layout.default.js
src/module/layout.default.js
+10
-9
layout.js
src/module/layout.js
+6
-6
contract.png
themes/default/images/contract.png
+0
-0
expand.png
themes/default/images/expand.png
+0
-0
No files found.
src/adapter/layout.js
View file @
1cb8fe62
...
...
@@ -10,16 +10,16 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) {
itemStyles
:
[],
value
:
me
.
getLayoutStyleItems
(),
autowidthitem
:
[],
enabledRecord
:
false
enabledRecord
:
false
},
$combox
=
null
;
if
(
options
.
items
.
length
==
0
)
{
return
null
;
}
utils
.
each
(
options
.
items
,
function
(
i
,
item
)
{
options
.
items
[
i
]
=
me
.
getLang
(
'layout'
)[
item
];
});
utils
.
each
(
options
.
items
,
function
(
i
,
item
)
{
options
.
items
[
i
]
=
me
.
getLang
(
'layout'
)[
item
];
}
);
//实例化
$combox
=
$
.
kmuibuttoncombobox
(
options
).
css
(
'zIndex'
,
me
.
getOptions
(
'zIndex'
)
+
1
);
var
comboboxWidget
=
$combox
.
kmui
();
...
...
@@ -49,18 +49,18 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) {
}
);
var
data
=
[];
utils
.
each
(
me
.
getLayoutStyleItems
(),
function
(
i
,
v
)
{
data
.
push
({
label
:
me
.
getLang
(
'tooltips.'
+
name
)
+
' '
+
v
,
cmdName
:
'switchlayout'
,
exec
:
function
()
{
me
.
execCommand
(
'switchlayout'
,
v
);
utils
.
each
(
me
.
getLayoutStyleItems
(),
function
(
i
,
v
)
{
data
.
push
(
{
label
:
me
.
getLang
(
'tooltips.'
+
name
)
+
' '
+
v
,
cmdName
:
'switchlayout'
,
exec
:
function
()
{
me
.
execCommand
(
'switchlayout'
,
v
);
}
})
});
data
.
push
({
divider
:
1
});
me
.
addContextmenu
(
data
);
}
)
}
);
data
.
push
(
{
divider
:
1
}
);
me
.
addContextmenu
(
data
);
return
comboboxWidget
.
button
().
addClass
(
'kmui-combobox'
);
}
);
\ No newline at end of file
src/adapter/view.js
View file @
1cb8fe62
...
...
@@ -4,6 +4,7 @@ KM.registerToolbarUI( 'hand zoom-in zoom-out expand contract',
var
$btn
=
$
.
kmuibutton
(
{
icon
:
name
,
click
:
function
()
{
console
.
log
(
name
);
me
.
execCommand
(
name
);
},
title
:
this
.
getLang
(
'tooltips.'
)[
name
]
||
''
...
...
src/module/expand.js
0 → 100644
View file @
1cb8fe62
KityMinder
.
registerModule
(
"Expand"
,
function
()
{
var
ExpandCommand
=
kity
.
createClass
(
"ExpandCommand"
,
(
function
()
{
return
{
base
:
Command
,
execute
:
function
(
km
)
{
km
.
initStyle
(
true
);
},
queryState
:
function
(
km
)
{
return
0
;
}
};
}
)()
);
var
ContractCommand
=
kity
.
createClass
(
"ContractCommand"
,
(
function
()
{
return
{
base
:
Command
,
execute
:
function
(
km
)
{
km
.
initStyle
();
},
queryState
:
function
(
km
)
{
return
0
;
}
};
}
)()
);
return
{
'commands'
:
{
'expand'
:
ExpandCommand
,
'contract'
:
ContractCommand
}
};
}
);
\ No newline at end of file
src/module/layout.default.js
View file @
1cb8fe62
...
...
@@ -423,7 +423,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
if
(
nodeType
!==
"root"
&&
node
.
getChildren
().
length
!==
0
)
{
if
(
!
Layout
.
shicon
)
{
Layout
.
shicon
=
new
ShIcon
(
node
);
if
(
node
.
getData
(
'expand'
)
)
{
if
(
Layout
.
expand
)
{
Layout
.
shicon
.
switchState
();
}
}
...
...
@@ -506,7 +506,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
this
.
highlightNode
(
node
)
}
},
initStyle
:
function
()
{
initStyle
:
function
(
expandall
)
{
var
_root
=
minder
.
getRoot
();
var
historyPoint
=
_root
.
getPoint
();
if
(
historyPoint
)
historyPoint
=
JSON
.
parse
(
JSON
.
stringify
(
historyPoint
)
);
...
...
@@ -553,8 +553,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
return
items
;
}
)();
next
=
[];
var
layer_nolimit
=
(
expand_layer
<
1
)
||
false
;
var
sub_nolimit
=
(
expandoptions
.
defaultSubShow
<
1
)
||
false
;
var
layer_nolimit
=
expandall
||
(
expand_layer
<
1
)
||
false
;
var
sub_nolimit
=
expandall
||
(
expandoptions
.
defaultSubShow
<
1
)
||
false
;
var
loopcontinue
=
function
()
{
return
(
layer_nolimit
?
(
_buffer
.
length
!==
0
)
:
(
_buffer
.
length
!==
0
&&
cur_layer
<
expand_layer
)
);
};
...
...
@@ -573,17 +573,17 @@ KityMinder.registerModule( "LayoutDefault", function () {
_root
.
setPoint
(
_root
.
getLayout
().
x
,
_root
.
getLayout
().
y
);
},
appendChildNode
:
function
(
parent
,
node
,
focus
,
sibling
)
{
if
(
parent
.
getType
()
!==
"root"
&&
parent
.
getChildren
().
length
!==
0
&&
parent
.
get
Data
(
"expand"
)
===
false
)
{
if
(
parent
.
getType
()
!==
"root"
&&
parent
.
getChildren
().
length
!==
0
&&
parent
.
get
Layout
().
expand
===
false
)
{
minder
.
expandNode
(
parent
);
}
minder
.
handelNodeInsert
(
node
);
node
.
clearLayout
();
node
.
getContRc
().
clear
();
node
.
setData
(
'expand'
,
false
);
var
Layout
=
node
.
getLayout
();
Layout
.
expand
=
false
;
if
(
parent
.
getType
()
!==
'root'
)
{
parent
.
setData
(
'expand'
,
true
)
;
parent
.
getLayout
().
expand
=
true
;
}
var
Layout
=
node
.
getLayout
();
Layout
.
added
=
true
;
var
parentLayout
=
parent
.
getLayout
();
var
children
=
parent
.
getChildren
();
...
...
@@ -739,7 +739,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
isExpand
=
ico
.
icon
.
switchState
();
node
=
ico
.
icon
.
_node
;
}
node
.
setData
(
"expand"
,
isExpand
);
var
Layout
=
node
.
getLayout
();
Layout
.
expand
=
isExpand
;
var
_buffer
=
node
.
getChildren
();
if
(
isExpand
)
{
for
(
var
j
=
0
;
j
<
_buffer
.
length
;
j
++
)
{
...
...
src/module/layout.js
View file @
1cb8fe62
...
...
@@ -32,7 +32,7 @@ KityMinder.registerModule( "LayoutModule", function () {
var
curStyle
=
this
.
getCurrentStyle
();
this
.
getLayoutStyle
(
curStyle
).
highlightNode
.
call
(
this
,
node
);
},
initStyle
:
function
()
{
initStyle
:
function
(
expandall
)
{
var
curStyle
=
this
.
getCurrentStyle
();
this
.
_rc
.
remove
();
this
.
_rc
=
new
kity
.
Group
();
...
...
@@ -42,7 +42,7 @@ KityMinder.registerModule( "LayoutModule", function () {
_root
.
preTraverse
(
function
(
n
)
{
n
.
clearLayout
();
}
);
this
.
getLayoutStyle
(
curStyle
).
initStyle
.
call
(
this
);
this
.
getLayoutStyle
(
curStyle
).
initStyle
.
call
(
this
,
expandall
);
this
.
fire
(
'afterinitstyle'
);
},
appendChildNode
:
function
(
parent
,
node
,
focus
,
index
)
{
...
...
@@ -246,7 +246,7 @@ KityMinder.registerModule( "LayoutModule", function () {
}.
bind
(
this
),
100
);
},
"import"
:
function
(
e
)
{
this
.
initStyle
(
this
.
getRoot
()
);
this
.
initStyle
();
}
},
'contextmenu'
:
[
{
...
...
themes/default/images/contract.png
View replaced file @
6c6eede3
View file @
1cb8fe62
1.11 KB
|
W:
|
H:
2.93 KB
|
W:
|
H:
2-up
Swipe
Onion skin
themes/default/images/expand.png
View replaced file @
6c6eede3
View file @
1cb8fe62
3.28 KB
|
W:
|
H:
2.98 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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