Commit d03f87ef authored by campaign's avatar campaign

by zhanyi

parent 82edd911
...@@ -32,6 +32,10 @@ KM.registerUI( 'contextmenu', function () { ...@@ -32,6 +32,10 @@ KM.registerUI( 'contextmenu', function () {
var data = []; var data = [];
utils.each(items,function(i,item){ utils.each(items,function(i,item){
if(item.divider){
data.push(item)
return;
}
if(me.queryCommandState(item.cmdName)!=-1){ if(me.queryCommandState(item.cmdName)!=-1){
data.push({ data.push({
label:item.label, label:item.label,
...@@ -41,7 +45,10 @@ KM.registerUI( 'contextmenu', function () { ...@@ -41,7 +45,10 @@ KM.registerUI( 'contextmenu', function () {
} }
}); });
if(data.length){ if(data.length){
var item = data[data.length-1];
if(item.divider){
data.pop();
}
$menu.kmui().setData({ $menu.kmui().setData({
data:data data:data
}).position(e.getPosition()).show(); }).position(e.getPosition()).show();
......
...@@ -53,7 +53,9 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) { ...@@ -53,7 +53,9 @@ KM.registerToolbarUI( 'switchlayout', function ( name ) {
} }
}) })
}); });
data.push({
divider:1
});
me.addContextmenu(data); me.addContextmenu(data);
return comboboxWidget.button().addClass( 'kmui-combobox' ); return comboboxWidget.button().addClass( 'kmui-combobox' );
} ); } );
\ No newline at end of file
...@@ -221,6 +221,8 @@ KityMinder.registerModule( "LayoutModule", function () { ...@@ -221,6 +221,8 @@ KityMinder.registerModule( "LayoutModule", function () {
{ {
label:this.getLang('node.removenode'), label:this.getLang('node.removenode'),
cmdName:'removenode' cmdName:'removenode'
},{
divider:1
} }
], ],
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
left: auto; left: auto;
} }
.kmui-dropdown-menu .divider { .kmui-dropdown-menu .kmui-divider {
height: 1px; height: 1px;
margin: 9px 0; margin: 9px 0;
overflow: hidden; overflow: hidden;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment