Commit d052d531 authored by campaign's avatar campaign

by zhanyi

parent e02893e6
......@@ -64,6 +64,7 @@ $dependency = Array(
,'src/adapter/tooltips.js'
,'src/adapter/layout.js'
,'src/adapter/node.js'
,'src/adapter/contextmenu.js'
,'src/protocal/plain.js'
,'src/protocal/json.js'
,'src/protocal/png.js'
......
......@@ -13,7 +13,7 @@ kity.extendClass( Minder, {
},
// TODO: mousemove lazy bind
_bindPaperEvents: function () {
this._paper.on( 'click dblclick mousedown mouseup mousemove mousewheel touchstart touchmove touchend', this._firePharse.bind( this ) );
this._paper.on( 'click dblclick mousedown contextmenu mouseup mousemove mousewheel touchstart touchmove touchend', this._firePharse.bind( this ) );
if ( window ) {
window.addEventListener( 'resize', this._firePharse.bind( this ) );
}
......
......@@ -16,6 +16,7 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
this._initMinder();
this._initSelection();
this._initShortcutKey();
this._initContextmenu();
this._initModules();
this.fire( 'ready' );
......@@ -138,6 +139,21 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
}
} );
},
_initContextmenu:function(){
this.contextmenus = [];
},
addContextmenu:function(item){
if(utils.isArray(item)){
this.contextmenus = this.contextmenus.concat(item);
}else{
this.contextmenus.push(item);
}
return this;
},
getContextmenu:function(){
return this.contextmenus;
}
} );
......
......@@ -46,6 +46,10 @@ kity.extendClass( Minder, {
this.addShortcutKeys( moduleDeals.addShortcutKeys )
}
//添加邮件菜单
if(moduleDeals.contextmenu){
this.addContextmenu(moduleDeals.contextmenu)
}
}
},
......
......@@ -202,6 +202,21 @@ KityMinder.registerModule( "LayoutModule", function () {
this.initStyle( this.getRoot() );
}
},
'contextmenu':[
{
label:this.getLang('node.appendsiblingnode'),
cmdName:'appendsiblingnode'
},
{
label:this.getLang('node.appendchildnode'),
cmdName:'appendchildnode'
},
{
label:this.getLang('node.removenode'),
cmdName:'removenode'
}
],
"defaultOptions": {
"defaultlayoutstyle": "default",
"node": {
......
......@@ -12,3 +12,4 @@
@import "colorpicker.css";
@import "separator.css";
@import "markers.css";
@import "dropmenu.css";
\ No newline at end of file
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