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
Hide 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 ) {
...
@@ -10,16 +10,16 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) {
itemStyles
:
[],
itemStyles
:
[],
value
:
me
.
getLayoutStyleItems
(),
value
:
me
.
getLayoutStyleItems
(),
autowidthitem
:
[],
autowidthitem
:
[],
enabledRecord
:
false
enabledRecord
:
false
},
},
$combox
=
null
;
$combox
=
null
;
if
(
options
.
items
.
length
==
0
)
{
if
(
options
.
items
.
length
==
0
)
{
return
null
;
return
null
;
}
}
utils
.
each
(
options
.
items
,
function
(
i
,
item
)
{
utils
.
each
(
options
.
items
,
function
(
i
,
item
)
{
options
.
items
[
i
]
=
me
.
getLang
(
'layout'
)[
item
];
options
.
items
[
i
]
=
me
.
getLang
(
'layout'
)[
item
];
});
}
);
//实例化
//实例化
$combox
=
$
.
kmuibuttoncombobox
(
options
).
css
(
'zIndex'
,
me
.
getOptions
(
'zIndex'
)
+
1
);
$combox
=
$
.
kmuibuttoncombobox
(
options
).
css
(
'zIndex'
,
me
.
getOptions
(
'zIndex'
)
+
1
);
var
comboboxWidget
=
$combox
.
kmui
();
var
comboboxWidget
=
$combox
.
kmui
();
...
@@ -49,18 +49,18 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) {
...
@@ -49,18 +49,18 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) {
}
);
}
);
var
data
=
[];
var
data
=
[];
utils
.
each
(
me
.
getLayoutStyleItems
(),
function
(
i
,
v
)
{
utils
.
each
(
me
.
getLayoutStyleItems
(),
function
(
i
,
v
)
{
data
.
push
({
data
.
push
(
{
label
:
me
.
getLang
(
'tooltips.'
+
name
)
+
' '
+
v
,
label
:
me
.
getLang
(
'tooltips.'
+
name
)
+
' '
+
v
,
cmdName
:
'switchlayout'
,
cmdName
:
'switchlayout'
,
exec
:
function
()
{
exec
:
function
()
{
me
.
execCommand
(
'switchlayout'
,
v
);
me
.
execCommand
(
'switchlayout'
,
v
);
}
}
})
}
)
});
}
);
data
.
push
({
data
.
push
(
{
divider
:
1
divider
:
1
});
}
);
me
.
addContextmenu
(
data
);
me
.
addContextmenu
(
data
);
return
comboboxWidget
.
button
().
addClass
(
'kmui-combobox'
);
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',
...
@@ -4,6 +4,7 @@ KM.registerToolbarUI( 'hand zoom-in zoom-out expand contract',
var
$btn
=
$
.
kmuibutton
(
{
var
$btn
=
$
.
kmuibutton
(
{
icon
:
name
,
icon
:
name
,
click
:
function
()
{
click
:
function
()
{
console
.
log
(
name
);
me
.
execCommand
(
name
);
me
.
execCommand
(
name
);
},
},
title
:
this
.
getLang
(
'tooltips.'
)[
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 () {
...
@@ -423,7 +423,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
if
(
nodeType
!==
"root"
&&
node
.
getChildren
().
length
!==
0
)
{
if
(
nodeType
!==
"root"
&&
node
.
getChildren
().
length
!==
0
)
{
if
(
!
Layout
.
shicon
)
{
if
(
!
Layout
.
shicon
)
{
Layout
.
shicon
=
new
ShIcon
(
node
);
Layout
.
shicon
=
new
ShIcon
(
node
);
if
(
node
.
getData
(
'expand'
)
)
{
if
(
Layout
.
expand
)
{
Layout
.
shicon
.
switchState
();
Layout
.
shicon
.
switchState
();
}
}
}
}
...
@@ -506,7 +506,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -506,7 +506,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
this
.
highlightNode
(
node
)
this
.
highlightNode
(
node
)
}
}
},
},
initStyle
:
function
()
{
initStyle
:
function
(
expandall
)
{
var
_root
=
minder
.
getRoot
();
var
_root
=
minder
.
getRoot
();
var
historyPoint
=
_root
.
getPoint
();
var
historyPoint
=
_root
.
getPoint
();
if
(
historyPoint
)
historyPoint
=
JSON
.
parse
(
JSON
.
stringify
(
historyPoint
)
);
if
(
historyPoint
)
historyPoint
=
JSON
.
parse
(
JSON
.
stringify
(
historyPoint
)
);
...
@@ -553,8 +553,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -553,8 +553,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
return
items
;
return
items
;
}
)();
}
)();
next
=
[];
next
=
[];
var
layer_nolimit
=
(
expand_layer
<
1
)
||
false
;
var
layer_nolimit
=
expandall
||
(
expand_layer
<
1
)
||
false
;
var
sub_nolimit
=
(
expandoptions
.
defaultSubShow
<
1
)
||
false
;
var
sub_nolimit
=
expandall
||
(
expandoptions
.
defaultSubShow
<
1
)
||
false
;
var
loopcontinue
=
function
()
{
var
loopcontinue
=
function
()
{
return
(
layer_nolimit
?
(
_buffer
.
length
!==
0
)
:
(
_buffer
.
length
!==
0
&&
cur_layer
<
expand_layer
)
);
return
(
layer_nolimit
?
(
_buffer
.
length
!==
0
)
:
(
_buffer
.
length
!==
0
&&
cur_layer
<
expand_layer
)
);
};
};
...
@@ -573,17 +573,17 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -573,17 +573,17 @@ KityMinder.registerModule( "LayoutDefault", function () {
_root
.
setPoint
(
_root
.
getLayout
().
x
,
_root
.
getLayout
().
y
);
_root
.
setPoint
(
_root
.
getLayout
().
x
,
_root
.
getLayout
().
y
);
},
},
appendChildNode
:
function
(
parent
,
node
,
focus
,
sibling
)
{
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
.
expandNode
(
parent
);
}
}
minder
.
handelNodeInsert
(
node
);
minder
.
handelNodeInsert
(
node
);
node
.
clearLayout
();
node
.
clearLayout
();
node
.
getContRc
().
clear
();
node
.
getContRc
().
clear
();
node
.
setData
(
'expand'
,
false
);
var
Layout
=
node
.
getLayout
();
Layout
.
expand
=
false
;
if
(
parent
.
getType
()
!==
'root'
)
{
if
(
parent
.
getType
()
!==
'root'
)
{
parent
.
setData
(
'expand'
,
true
)
;
parent
.
getLayout
().
expand
=
true
;
}
}
var
Layout
=
node
.
getLayout
();
Layout
.
added
=
true
;
Layout
.
added
=
true
;
var
parentLayout
=
parent
.
getLayout
();
var
parentLayout
=
parent
.
getLayout
();
var
children
=
parent
.
getChildren
();
var
children
=
parent
.
getChildren
();
...
@@ -739,7 +739,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -739,7 +739,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
isExpand
=
ico
.
icon
.
switchState
();
isExpand
=
ico
.
icon
.
switchState
();
node
=
ico
.
icon
.
_node
;
node
=
ico
.
icon
.
_node
;
}
}
node
.
setData
(
"expand"
,
isExpand
);
var
Layout
=
node
.
getLayout
();
Layout
.
expand
=
isExpand
;
var
_buffer
=
node
.
getChildren
();
var
_buffer
=
node
.
getChildren
();
if
(
isExpand
)
{
if
(
isExpand
)
{
for
(
var
j
=
0
;
j
<
_buffer
.
length
;
j
++
)
{
for
(
var
j
=
0
;
j
<
_buffer
.
length
;
j
++
)
{
...
...
src/module/layout.js
View file @
1cb8fe62
...
@@ -32,7 +32,7 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -32,7 +32,7 @@ KityMinder.registerModule( "LayoutModule", function () {
var
curStyle
=
this
.
getCurrentStyle
();
var
curStyle
=
this
.
getCurrentStyle
();
this
.
getLayoutStyle
(
curStyle
).
highlightNode
.
call
(
this
,
node
);
this
.
getLayoutStyle
(
curStyle
).
highlightNode
.
call
(
this
,
node
);
},
},
initStyle
:
function
()
{
initStyle
:
function
(
expandall
)
{
var
curStyle
=
this
.
getCurrentStyle
();
var
curStyle
=
this
.
getCurrentStyle
();
this
.
_rc
.
remove
();
this
.
_rc
.
remove
();
this
.
_rc
=
new
kity
.
Group
();
this
.
_rc
=
new
kity
.
Group
();
...
@@ -42,7 +42,7 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -42,7 +42,7 @@ KityMinder.registerModule( "LayoutModule", function () {
_root
.
preTraverse
(
function
(
n
)
{
_root
.
preTraverse
(
function
(
n
)
{
n
.
clearLayout
();
n
.
clearLayout
();
}
);
}
);
this
.
getLayoutStyle
(
curStyle
).
initStyle
.
call
(
this
);
this
.
getLayoutStyle
(
curStyle
).
initStyle
.
call
(
this
,
expandall
);
this
.
fire
(
'afterinitstyle'
);
this
.
fire
(
'afterinitstyle'
);
},
},
appendChildNode
:
function
(
parent
,
node
,
focus
,
index
)
{
appendChildNode
:
function
(
parent
,
node
,
focus
,
index
)
{
...
@@ -213,9 +213,9 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -213,9 +213,9 @@ KityMinder.registerModule( "LayoutModule", function () {
return
0
;
return
0
;
}
}
},
},
isNeedUndo
:
function
()
{
isNeedUndo
:
function
()
{
return
false
;
return
false
;
}
}
};
};
}
)()
);
}
)()
);
...
@@ -246,7 +246,7 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -246,7 +246,7 @@ KityMinder.registerModule( "LayoutModule", function () {
}.
bind
(
this
),
100
);
}.
bind
(
this
),
100
);
},
},
"import"
:
function
(
e
)
{
"import"
:
function
(
e
)
{
this
.
initStyle
(
this
.
getRoot
()
);
this
.
initStyle
();
}
}
},
},
'contextmenu'
:
[
{
'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