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
65a7d306
Commit
65a7d306
authored
Feb 24, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
by zhanyi
parent
051e2621
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
dropmenu.js
src/ui/dropmenu.js
+22
-5
No files found.
src/ui/dropmenu.js
View file @
65a7d306
//dropmenu 类
KM
.
ui
.
define
(
'dropmenu'
,
{
tmpl
:
'<ul class="kmui-dropdown-menu" aria-labelledby="dropdownMenu" >'
+
'<%for(var i=0,ci;ci=data[i++];){%>'
+
this
.
subTmpl
+
'</ul>'
,
subTmpl
:
'<%if(data && data.length){for(var i=0,ci;ci=data[i++];){%>'
+
'<%if(ci.divider){%><li class="kmui-divider"></li><%}else{%>'
+
'<li <%if(ci.active||ci.disabled){%>class="<%= ci.active||
\'\'
%> <%=ci.disabled||
\'\'
%>" <%}%> data-value="<%= ci.value%>">'
+
'<a href="#" tabindex="-1"><em class="kmui-dropmenu-checkbox"><i class="kmui-icon-ok"></i></em><%= ci.label%></a>'
+
'</li><%}%>'
+
'<%}%>'
+
'</ul>'
,
'</li><%}}%>'
+
'<%}%>'
,
defaultOpt
:
{
data
:
[],
click
:
function
()
{
}
},
setData
:
function
(
items
){
this
.
root
().
html
(
$
.
parseTmpl
(
this
.
subTmpl
,
items
));
return
this
;
},
position
:
function
(
offset
){
this
.
root
().
offset
(
offset
);
return
this
;
},
show
:
function
(){
if
(
this
.
trigger
(
'beforeshow'
)
===
false
){
return
;
}
else
{
this
.
root
().
css
({
display
:
'block'
});
this
.
trigger
(
'aftershow'
);
}
return
this
;
},
init
:
function
(
options
)
{
var
me
=
this
;
var
eventName
=
{
...
...
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