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
26207f8d
Commit
26207f8d
authored
Feb 26, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
by zhanyi01
parent
22825ca1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
14 deletions
+19
-14
dropmenu.js
src/ui/dropmenu.js
+17
-12
menu.js
src/ui/menu.js
+2
-2
No files found.
src/ui/dropmenu.js
View file @
26207f8d
//dropmenu 类
//dropmenu 类
KM
.
ui
.
define
(
'dropmenu'
,
{
KM
.
ui
.
define
(
'dropmenu'
,
{
tmpl
:
'<ul class="kmui-dropdown-menu" aria-labelledby="dropdownMenu" >'
+
tmpl
:
'<ul class="kmui-dropdown-menu" aria-labelledby="dropdownMenu" >'
+
this
.
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%>" data-label="<%= ci.label%>">'
+
'<a href="#" tabindex="-1"><em class="kmui-dropmenu-checkbox"><i class="kmui-icon-ok"></i></em><%= ci.label%></a>'
+
'</li><%}}%>'
+
'<%}%>'
+
'</ul>'
,
'</ul>'
,
subTmpl
:
'<%if(data && data.length){for(var i=0,ci;ci=data[i++];){%>'
+
subTmpl
:
'<%if(data && data.length){for(var i=0,ci;ci=data[i++];){%>'
+
'<%if(ci.divider){%><li class="kmui-divider"></li><%}else{%>'
+
'<%if(ci.divider){%><li class="kmui-divider"></li><%}else{%>'
+
'<li <%if(ci.active||ci.disabled){%>class="<%= ci.active||
\'\'
%> <%=ci.disabled||
\'\'
%>" <%}%> data-value="<%= ci.value%>" data-label="<%= ci.label%>">'
+
'<li <%if(ci.active||ci.disabled){%>class="<%= ci.active||
\'\'
%> <%=ci.disabled||
\'\'
%>" <%}%> data-value="<%= ci.value%>" data-label="<%= ci.label%>">'
+
'<a href="#" tabindex="-1"><em class="kmui-dropmenu-checkbox"><i class="kmui-icon-ok"></i></em><%= ci.label%></a>'
+
'<a href="#" tabindex="-1"><em class="kmui-dropmenu-checkbox"><i class="kmui-icon-ok"></i></em><%= ci.label%></a>'
+
...
@@ -16,7 +21,7 @@ KM.ui.define('dropmenu', {
...
@@ -16,7 +21,7 @@ KM.ui.define('dropmenu', {
},
},
setData
:
function
(
items
){
setData
:
function
(
items
){
this
.
root
().
html
(
$
.
parseTmpl
(
this
.
subTmpl
,
items
))
this
.
root
().
html
(
$
.
parseTmpl
(
this
.
subTmpl
,
items
))
;
return
this
;
return
this
;
},
},
...
@@ -27,15 +32,15 @@ KM.ui.define('dropmenu', {
...
@@ -27,15 +32,15 @@ KM.ui.define('dropmenu', {
});
});
return
this
;
return
this
;
},
},
//
show:function(){
show
:
function
(){
//
if(this.trigger('beforeshow') === false){
if
(
this
.
trigger
(
'beforeshow'
)
===
false
){
//
return;
return
;
//
}else{
}
else
{
//
this.root().css({display:'block'});
this
.
root
().
css
({
display
:
'block'
});
//
this.trigger('aftershow');
this
.
trigger
(
'aftershow'
);
//
}
}
//
return this;
return
this
;
//
},
},
init
:
function
(
options
)
{
init
:
function
(
options
)
{
var
me
=
this
;
var
me
=
this
;
var
eventName
=
{
var
eventName
=
{
...
...
src/ui/menu.js
View file @
26207f8d
//menu 类
//menu 类
KM
.
ui
.
define
(
'menu'
,{
KM
.
ui
.
define
(
'menu'
,{
show
:
function
(
$obj
,
dir
,
fnname
,
topOffset
,
leftOffset
){
show
:
function
(
$obj
,
dir
,
fnname
,
topOffset
,
leftOffset
){
fnname
=
fnname
||
'position'
;
fnname
=
fnname
||
'position'
;
if
(
this
.
trigger
(
'beforeshow'
)
===
false
){
if
(
this
.
trigger
(
'beforeshow'
)
===
false
){
return
;
return
;
}
else
{
}
else
{
this
.
root
().
css
(
$
.
extend
({
display
:
'block'
},
$obj
?
{
this
.
root
().
css
(
$
.
extend
({
display
:
'block'
},
$obj
?
{
top
:
$obj
[
fnname
]().
top
+
(
dir
==
'right'
?
0
:
$obj
.
outerHeight
())
-
(
topOffset
||
0
),
top
:
$obj
[
fnname
]().
top
+
(
dir
==
'right'
?
0
:
$obj
.
outerHeight
())
-
(
topOffset
||
0
),
left
:
$obj
[
fnname
]().
left
+
(
dir
==
'right'
?
$obj
.
outerWidth
()
:
0
)
-
(
leftOffset
||
0
)
left
:
$obj
[
fnname
]().
left
+
(
dir
==
'right'
?
$obj
.
outerWidth
()
:
0
)
-
(
leftOffset
||
0
)
...
@@ -32,7 +32,7 @@ KM.ui.define('menu',{
...
@@ -32,7 +32,7 @@ KM.ui.define('menu',{
if
(
!
$obj
.
data
(
'$mergeObj'
)){
if
(
!
$obj
.
data
(
'$mergeObj'
)){
$obj
.
data
(
'$mergeObj'
,
me
.
root
());
$obj
.
data
(
'$mergeObj'
,
me
.
root
());
$obj
.
on
(
'wrapclick'
,
function
(
evt
){
$obj
.
on
(
'wrapclick'
,
function
(
evt
){
me
.
s
how
(
)
me
.
s
upper
.
show
.
call
(
me
,
$obj
,
''
,
'offset'
)
});
});
me
.
register
(
'click'
,
$obj
,
function
(
evt
){
me
.
register
(
'click'
,
$obj
,
function
(
evt
){
me
.
hide
()
me
.
hide
()
...
...
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