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
701ea9bc
Commit
701ea9bc
authored
May 05, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改dialog下的偏好设置
parent
ffc41978
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
4 deletions
+41
-4
preference.js
dialogs/preference/preference.js
+41
-4
No files found.
dialogs/preference/preference.js
View file @
701ea9bc
...
@@ -3,17 +3,46 @@
...
@@ -3,17 +3,46 @@
var
preferenceContent
=
'<div class="help-content" style="padding:20px;width:360px;">'
;
var
preferenceContent
=
'<div class="help-content" style="padding:20px;width:360px;">'
;
preferenceContent
+=
'<h3>展开属性设置</h3>'
;
preferenceContent
+=
'<h3>展开属性设置</h3>'
;
preferenceContent
+=
'<p><label><input type="checkbox" name="expand" />是否全部展开</label></p>'
;
preferenceContent
+=
'<p><label><input type="checkbox" name="expand" />是否全部展开</label></p>'
;
preferenceContent
+=
'<p><hr/></p>'
;
preferenceContent
+=
'<p><button id="reset_preference">回复默认值</button></p>'
;
preferenceContent
+=
'<p><label><b style="color:red">有些偏好设置会在你下次刷新页面时生效</b></label></p>'
;
preferenceContent
+=
'</div>'
;
preferenceContent
+=
'</div>'
;
//todo 偏好设置暂时都在这里处理
//todo 偏好设置暂时都在这里处理
//用于在reset所有偏好时,清除这个dialog下的所有偏好
var
allPreferences
=
{};
function
execExpand
(
km
,
$w
){
function
checkEverything
(
km
,
$w
){
var
checked
=
$w
.
find
(
'[name=expand]'
).
checked
();
checkExpand
(
km
,
$w
)
if
(
checked
){
}
function
initEverything
(
km
,
$w
){
initExpand
(
km
,
$w
)
}
//展开
function
initExpand
(
km
,
$w
){
var
expand
=
km
.
getOptions
(
'defaultExpand'
);
$w
.
find
(
'[name=expand]'
)[
0
].
checked
=
expand
&&
expand
.
defaultLayer
==
0
;
allPreferences
[
'defaultExpand'
]
=
null
;
}
function
checkExpand
(
km
,
$w
){
var
checked
=
$w
.
find
(
'[name=expand]'
)[
0
].
checked
;
if
(
checked
){
km
.
setPreferences
(
'defaultExpand'
,{
'defaultLayer'
:
0
,
'defaultSubShow'
:
0
})
}
else
{
km
.
setPreferences
(
'defaultExpand'
)
}
}
}
}
//重置偏好
function
resetPreferences
(
km
){
km
.
setPreferences
(
allPreferences
)
}
KM
.
registerWidget
(
'preference'
,
{
KM
.
registerWidget
(
'preference'
,
{
tpl
:
preferenceContent
,
tpl
:
preferenceContent
,
initContent
:
function
(
km
)
{
initContent
:
function
(
km
)
{
...
@@ -26,9 +55,17 @@
...
@@ -26,9 +55,17 @@
},
},
initEvent
:
function
(
km
,
$w
)
{
initEvent
:
function
(
km
,
$w
)
{
//绑定默认值
initEverything
(
km
,
$w
);
$w
.
on
(
'click'
,
'.kmui-close'
,
function
(
e
)
{
$w
.
find
(
'#reset_preference'
).
on
(
'click'
,
function
(
e
)
{
resetPreferences
(
km
);
//重置系统默认的偏好设置
initEverything
(
km
,
$w
)
}
);
$w
.
on
(
'click'
,
'.kmui-close'
,
function
(
e
)
{
checkEverything
(
km
,
$w
);
km
.
fire
(
'preferencechange'
)
km
.
fire
(
'preferencechange'
)
}
);
}
);
},
},
...
...
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