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
5da5147a
Commit
5da5147a
authored
Mar 24, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
publish
parent
70ae9c51
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
73 deletions
+81
-73
kityminder.all.js
dist/kityminder.all.js
+78
-70
kityminder.all.min.js
dist/kityminder.all.min.js
+3
-3
No files found.
dist/kityminder.all.js
View file @
5da5147a
/*!
* ====================================================
* kityminder - v1.0.0 - 2014-03-
19
* kityminder - v1.0.0 - 2014-03-
24
* https://github.com/fex-team/kityminder
* GitHub: https://github.com/fex-team/kityminder.git
* Copyright (c) 2014 f-cube @ FEX; Licensed MIT
...
...
@@ -12,7 +12,7 @@
var
KityMinder
=
window
.
KM
=
window
.
KityMinder
=
function
()
{
var
instanceMap
=
{},
instanceId
=
0
;
return
{
version
:
'1.1.
0
'
,
version
:
'1.1.
1
'
,
createMinder
:
function
(
renderTarget
,
options
)
{
options
=
options
||
{};
options
.
renderTo
=
Utils
.
isString
(
renderTarget
)
?
document
.
getElementById
(
renderTarget
)
:
renderTarget
;
...
...
@@ -1450,7 +1450,11 @@ var keymap = KityMinder.keymap = {
'y'
:
89
,
//粘贴
'v'
:
86
,
'x'
:
88
'x'
:
88
,
's'
:
83
,
'n'
:
78
};
//添加多语言模块
...
...
@@ -5555,16 +5559,16 @@ KM.ui.define('menu',{
});
//dropmenu 类
KM
.
ui
.
define
(
'dropmenu'
,
{
KM
.
ui
.
define
(
'dropmenu'
,
{
tmpl
:
'<ul class="kmui-dropdown-menu" aria-labelledby="dropdownMenu" >'
+
'<%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>'
,
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{%>'
+
'<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>'
+
...
...
@@ -5572,32 +5576,34 @@ KM.ui.define('dropmenu', {
'<%}%>'
,
defaultOpt
:
{
data
:
[],
click
:
function
()
{
}
anchor
:
'top'
,
click
:
function
()
{
}
},
setData
:
function
(
items
)
{
setData
:
function
(
items
)
{
this
.
root
().
html
(
$
.
parseTmpl
(
this
.
subTmpl
,
items
)
);
this
.
root
().
html
(
$
.
parseTmpl
(
this
.
subTmpl
,
items
)
);
return
this
;
},
position
:
function
(
offset
)
{
this
.
root
().
css
({
left
:
offset
.
x
,
top
:
offset
.
y
});
position
:
function
(
offset
)
{
this
.
root
().
css
(
{
left
:
offset
.
x
,
top
:
offset
.
y
}
);
return
this
;
},
show
:
function
()
{
if
(
this
.
trigger
(
'beforeshow'
)
===
false
)
{
show
:
function
()
{
if
(
this
.
trigger
(
'beforeshow'
)
===
false
)
{
return
;
}
else
{
this
.
root
().
css
({
display
:
'block'
});
this
.
trigger
(
'aftershow'
);
}
else
{
this
.
root
().
css
(
{
display
:
'block'
}
);
this
.
trigger
(
'aftershow'
);
}
return
this
;
},
init
:
function
(
options
)
{
init
:
function
(
options
)
{
var
me
=
this
;
var
eventName
=
{
click
:
1
,
...
...
@@ -5605,55 +5611,57 @@ KM.ui.define('dropmenu', {
mouseout
:
1
};
this
.
root
(
$
(
$
.
parseTmpl
(
this
.
tmpl
,
options
))).
on
(
'click'
,
'li[class!="kmui-disabled kmui-divider kmui-dropdown-submenu"]'
,
function
(
evt
)
{
$
.
proxy
(
options
.
click
,
me
,
evt
,
$
(
this
).
data
(
'value'
),
$
(
this
).
data
(
'label'
),
$
(
this
))()
}).
find
(
'li'
).
each
(
function
(
i
,
el
)
{
var
$this
=
$
(
this
);
if
(
!
$this
.
hasClass
(
"kmui-disabled kmui-divider kmui-dropdown-submenu"
))
{
var
data
=
options
.
data
[
i
];
$
.
each
(
eventName
,
function
(
k
)
{
data
[
k
]
&&
$this
[
k
](
function
(
evt
)
{
$
.
proxy
(
data
[
k
],
el
)(
evt
,
data
,
me
.
root
)
})
})
}
});
this
.
root
(
$
(
$
.
parseTmpl
(
this
.
tmpl
,
options
)
)
).
on
(
'click'
,
'li[class!="kmui-disabled kmui-divider kmui-dropdown-submenu"]'
,
function
(
evt
)
{
$
.
proxy
(
options
.
click
,
me
,
evt
,
$
(
this
).
data
(
'value'
),
$
(
this
).
data
(
'label'
),
$
(
this
)
)();
}
).
find
(
'li'
).
each
(
function
(
i
,
el
)
{
var
$this
=
$
(
this
);
if
(
!
$this
.
hasClass
(
"kmui-disabled kmui-divider kmui-dropdown-submenu"
)
)
{
var
data
=
options
.
data
[
i
];
$
.
each
(
eventName
,
function
(
k
)
{
if
(
data
[
k
]
)
{
$this
[
k
](
function
(
evt
)
{
$
.
proxy
(
data
[
k
],
el
)(
evt
,
data
,
me
.
root
);
}
);
}
}
);
}
}
);
},
_initEvent
:
function
()
{
this
.
root
().
on
(
'mouseover'
,
'li[class="kmui-dropdown-submenu'
,
function
(
e
)
{
var
$submenu
=
$
(
this
).
data
(
'widget'
);
$submenu
.
kmui
().
show
(
$
(
this
),
'right'
,
'position'
,
5
,
2
)
});
_initEvent
:
function
()
{
this
.
root
().
on
(
'mouseover'
,
'li[class="kmui-dropdown-submenu'
,
function
(
e
)
{
var
$submenu
=
$
(
this
).
data
(
'widget'
);
$submenu
.
kmui
().
show
(
$
(
this
),
'right'
,
'position'
,
5
,
2
);
}
);
},
disabled
:
function
(
cb
)
{
$
(
'li[class!=kmui-divider]'
,
this
.
root
()).
each
(
function
()
{
var
$el
=
$
(
this
);
if
(
cb
===
true
)
{
$el
.
addClass
(
'kmui-disabled'
)
}
else
if
(
$
.
isFunction
(
cb
)
)
{
$el
.
toggleClass
(
'kmui-disabled'
,
cb
(
li
))
disabled
:
function
(
cb
)
{
$
(
'li[class!=kmui-divider]'
,
this
.
root
()
).
each
(
function
()
{
var
$el
=
$
(
this
);
if
(
cb
===
true
)
{
$el
.
addClass
(
'kmui-disabled'
);
}
else
if
(
$
.
isFunction
(
cb
)
)
{
$el
.
toggleClass
(
'kmui-disabled'
,
cb
(
$el
)
);
}
else
{
$el
.
removeClass
(
'kmui-disabled'
)
$el
.
removeClass
(
'kmui-disabled'
);
}
});
}
);
},
val
:
function
(
val
)
{
val
:
function
(
val
)
{
var
currentVal
;
$
(
'li[class!="kmui-divider kmui-disabled kmui-dropdown-submenu"]'
,
this
.
root
()).
each
(
function
()
{
var
$el
=
$
(
this
);
if
(
val
===
undefined
)
{
if
(
$el
.
find
(
'em.kmui-dropmenu-checked'
).
length
)
{
currentVal
=
$el
.
data
(
'value'
);
return
false
$
(
'li[class!="kmui-divider kmui-disabled kmui-dropdown-submenu"]'
,
this
.
root
()
).
each
(
function
()
{
var
$el
=
$
(
this
);
if
(
val
===
undefined
)
{
if
(
$el
.
find
(
'em.kmui-dropmenu-checked'
).
length
)
{
currentVal
=
$el
.
data
(
'value'
);
return
false
;
}
}
else
{
$el
.
find
(
'em'
).
toggleClass
(
'kmui-dropmenu-checked'
,
$el
.
data
(
'value'
)
==
val
)
$el
.
find
(
'em'
).
toggleClass
(
'kmui-dropmenu-checked'
,
$el
.
data
(
'value'
)
==
val
);
}
});
if
(
val
===
undefined
)
{
return
currentVal
}
);
if
(
val
===
undefined
)
{
return
currentVal
;
}
},
appendItem
:
function
(
item
)
{
...
...
@@ -5665,21 +5673,21 @@ KM.ui.define('dropmenu', {
var
$item
=
$
(
html
).
click
(
item
.
click
);
this
.
root
().
append
(
$item
);
},
addSubmenu
:
function
(
label
,
menu
,
index
)
{
addSubmenu
:
function
(
label
,
menu
,
index
)
{
index
=
index
||
0
;
var
$list
=
$
(
'li[class!=kmui-divider]'
,
this
.
root
()
);
var
$node
=
$
(
'<li class="kmui-dropdown-submenu"><a tabindex="-1" href="#">'
+
label
+
'</a></li>'
).
append
(
menu
);
$node
.
data
(
'widget'
,
menu
);
if
(
index
>=
0
&&
index
<
$list
.
length
)
{
$node
.
insertBefore
(
$list
[
index
]
);
}
else
if
(
index
<
0
)
{
$node
.
insertBefore
(
$list
[
0
]
);
}
else
if
(
index
>=
$list
.
length
)
{
$node
.
appendTo
(
$list
);
var
$list
=
$
(
'li[class!=kmui-divider]'
,
this
.
root
()
);
var
$node
=
$
(
'<li class="kmui-dropdown-submenu"><a tabindex="-1" href="#">'
+
label
+
'</a></li>'
).
append
(
menu
);
$node
.
data
(
'widget'
,
menu
);
if
(
index
>=
0
&&
index
<
$list
.
length
)
{
$node
.
insertBefore
(
$list
[
index
]
);
}
else
if
(
index
<
0
)
{
$node
.
insertBefore
(
$list
[
0
]
);
}
else
if
(
index
>=
$list
.
length
)
{
$node
.
appendTo
(
$list
);
}
}
},
'menu'
);
},
'menu'
);
//splitbutton 类
///import button
...
...
dist/kityminder.all.min.js
View file @
5da5147a
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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