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
8adf6816
Commit
8adf6816
authored
Feb 22, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
by zhanyi
parent
0c2f2610
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
21 deletions
+30
-21
configure.js
configure.js
+1
-1
zh-cn.js
lang/zh-cn/zh-cn.js
+1
-1
layout.js
src/adapter/layout.js
+13
-6
combobox.js
src/ui/combobox.js
+15
-13
No files found.
configure.js
View file @
8adf6816
...
@@ -63,7 +63,7 @@
...
@@ -63,7 +63,7 @@
'KITYMINDER_HOME_URL'
:
getKMBasePath
(),
'KITYMINDER_HOME_URL'
:
getKMBasePath
(),
//定义工具栏
//定义工具栏
toolbars
:
[
toolbars
:
[
'hand zoom-in zoom-out | undo redo | bold italic | fontfamily fontsize forecolor | saveto | markers | node | layout'
'hand zoom-in zoom-out | undo redo | bold italic | fontfamily fontsize forecolor | saveto | markers | node |
switch
layout'
]
]
//设置主题
//设置主题
...
...
lang/zh-cn/zh-cn.js
View file @
8adf6816
...
@@ -16,7 +16,7 @@ KityMinder.LANG[ 'zh-cn' ] = {
...
@@ -16,7 +16,7 @@ KityMinder.LANG[ 'zh-cn' ] = {
'zoom-in'
:
'放大'
,
'zoom-in'
:
'放大'
,
'zoom-out'
:
'缩小'
,
'zoom-out'
:
'缩小'
,
'markers'
:
'添加标签'
,
'markers'
:
'添加标签'
,
'layout'
:
'切换主题'
'
switch
layout'
:
'切换主题'
},
},
'popupcolor'
:
{
'popupcolor'
:
{
'clearColor'
:
'清空颜色'
,
'clearColor'
:
'清空颜色'
,
...
...
src/adapter/layout.js
View file @
8adf6816
KM
.
registerToolbarUI
(
'layout'
,
function
(
name
)
{
KM
.
registerToolbarUI
(
'switchlayout'
,
function
(
name
)
{
debugger
var
me
=
this
,
var
me
=
this
,
label
=
me
.
getLang
(
'tooltips.'
+
name
),
label
=
me
.
getLang
(
'tooltips.'
+
name
),
options
=
{
options
=
{
...
@@ -8,7 +9,8 @@ KM.registerToolbarUI( 'layout', function ( name ) {
...
@@ -8,7 +9,8 @@ KM.registerToolbarUI( 'layout', function ( name ) {
items
:
me
.
getLayoutStyleItems
()
||
[],
items
:
me
.
getLayoutStyleItems
()
||
[],
itemStyles
:
[],
itemStyles
:
[],
value
:
me
.
getLayoutStyleItems
(),
value
:
me
.
getLayoutStyleItems
(),
autowidthitem
:
[]
autowidthitem
:
[],
enabledRecord
:
false
},
},
$combox
=
null
;
$combox
=
null
;
if
(
options
.
items
.
length
==
0
)
{
if
(
options
.
items
.
length
==
0
)
{
...
@@ -20,20 +22,25 @@ KM.registerToolbarUI( 'layout', function ( name ) {
...
@@ -20,20 +22,25 @@ KM.registerToolbarUI( 'layout', function ( name ) {
comboboxWidget
=
$combox
.
kmui
();
comboboxWidget
=
$combox
.
kmui
();
comboboxWidget
.
on
(
'comboboxselect'
,
function
(
evt
,
res
)
{
comboboxWidget
.
on
(
'comboboxselect'
,
function
(
evt
,
res
)
{
me
.
execCommand
(
"switchlayout"
,
res
.
value
);
me
.
execCommand
(
name
,
res
.
value
);
}
).
on
(
"beforeshow"
,
function
()
{
}
).
on
(
"beforeshow"
,
function
()
{
if
(
$combox
.
parent
().
length
===
0
)
{
if
(
$combox
.
parent
().
length
===
0
)
{
$combox
.
appendTo
(
me
.
$container
.
find
(
'.kmui-dialog-container'
)
);
$combox
.
appendTo
(
me
.
$container
.
find
(
'.kmui-dialog-container'
)
);
}
}
}
);
}
);
//状态反射
me
.
on
(
'interactchange'
,
function
()
{
me
.
on
(
'interactchange'
,
function
()
{
var
value
=
this
.
queryCommandValue
(
"switchlayout"
);
var
state
=
this
.
queryCommandState
(
name
),
value
=
this
.
queryCommandValue
(
name
);
//设置按钮状态
comboboxWidget
.
button
().
kmui
().
disabled
(
state
==
-
1
).
active
(
state
==
1
);
if
(
value
)
{
if
(
value
)
{
//设置label
//设置label
value
=
value
.
replace
(
/
[
'"
]
/g
,
''
).
toLowerCase
().
split
(
/
[
'|"
]?\s
*,
\s
*
[\1]?
/
);
comboboxWidget
.
selectItemByLabel
(
value
);
comboboxWidget
.
selectItemByLabel
(
value
);
}
}
}
);
}
);
return
comboboxWidget
.
button
().
addClass
(
'kmui-combobox'
);
return
comboboxWidget
.
button
().
addClass
(
'kmui-combobox'
);
}
);
}
);
\ No newline at end of file
src/ui/combobox.js
View file @
8adf6816
...
@@ -134,9 +134,7 @@
...
@@ -134,9 +134,7 @@
*/
*/
select
:
function
(
index
){
select
:
function
(
index
){
if
(
!
this
.
data
(
'options'
).
enabledRecord
){
return
this
;
}
var
options
=
this
.
data
(
'options'
),
var
options
=
this
.
data
(
'options'
),
itemCount
=
options
.
itemCount
,
itemCount
=
options
.
itemCount
,
items
=
options
.
autowidthitem
;
items
=
options
.
autowidthitem
;
...
@@ -166,6 +164,7 @@
...
@@ -166,6 +164,7 @@
this
.
trigger
(
'changebefore'
,
items
[
index
]
);
this
.
trigger
(
'changebefore'
,
items
[
index
]
);
this
.
_update
(
index
);
this
.
_update
(
index
);
this
.
trigger
(
'changeafter'
,
items
[
index
]
);
this
.
trigger
(
'changeafter'
,
items
[
index
]
);
...
@@ -334,6 +333,7 @@
...
@@ -334,6 +333,7 @@
var
options
=
this
.
data
(
"options"
),
var
options
=
this
.
data
(
"options"
),
newStack
=
[];
newStack
=
[];
if
(
this
.
data
(
'options'
).
enabledRecord
){
$
.
each
(
options
.
recordStack
,
function
(
i
,
item
){
$
.
each
(
options
.
recordStack
,
function
(
i
,
item
){
if
(
item
!=
index
)
{
if
(
item
!=
index
)
{
...
@@ -350,6 +350,8 @@
...
@@ -350,6 +350,8 @@
}
}
options
.
recordStack
=
newStack
;
options
.
recordStack
=
newStack
;
}
options
.
selected
=
index
;
options
.
selected
=
index
;
this
.
_repaint
();
this
.
_repaint
();
...
...
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