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
75b05a77
Commit
75b05a77
authored
May 05, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加preferencechange事件
parent
0bea1af9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
preference.js
dialogs/preference/preference.js
+15
-11
No files found.
dialogs/preference/preference.js
View file @
75b05a77
(
function
()
{
//todo 这里先写死成中文
var
preferenceContent
=
'<div class="help-content" style="padding:20px;width:360px;">'
;
preferenceContent
+=
'<h3>展开属性设置</h3>'
;
preferenceContent
+=
'<p><label><input type="
radio" name="expand" checked value="all"/>全部展开</label><label><input type="radio" name="expand" value="limit"/>局
部展开</label></p>'
;
preferenceContent
+=
'<p><label><input type="
checkbox" name="expand" />是否全
部展开</label></p>'
;
preferenceContent
+=
'</div>'
;
//todo 偏好设置暂时都在这里处理
function
execExpand
(
km
,
$w
){
var
checked
=
$w
.
find
(
'[name=expand]'
).
checked
();
if
(
checked
){
}
}
KM
.
registerWidget
(
'preference'
,
{
tpl
:
preferenceContent
,
initContent
:
function
(
km
)
{
...
...
@@ -13,19 +23,13 @@
html
=
$
.
parseTmpl
(
this
.
tpl
,
lang
);
}
this
.
root
().
html
(
html
);
},
initEvent
:
function
(
km
,
$w
)
{
$w
.
on
(
'click'
,
'.kmui-close'
,
function
(
e
)
{
//写cookies
var
setCookie
=
function
(
name
,
value
,
exp
)
{
document
.
cookie
=
name
+
"="
+
escape
(
value
)
+
";expires="
+
exp
.
toGMTString
();
}
var
expand
=
$
(
"input[type='radio'][name='expand']:checked"
).
val
();
var
Days
=
30
;
var
exp
=
new
Date
();
exp
.
setTime
(
exp
.
getTime
()
+
Days
*
24
*
60
*
60
*
1000
);
setCookie
(
'expand'
,
expand
,
exp
);
console
.
log
(
document
.
cookie
);
km
.
fire
(
'preferencechange'
)
}
);
},
width
:
400
...
...
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