Commit 21f15934 authored by techird's avatar techird

merge branch 'dev' of github.com:fex-team/kityminder into dev

parents b30251e5 93fef115
......@@ -60,11 +60,13 @@
}
window.KITYMINDER_CONFIG = {
'KITYMINDER_HOME_URL': getKMBasePath(),
'KITYMINDER_HOME_URL': getKMBasePath()
//定义工具栏
toolbars: [
,toolbars: [
'hand zoom-in zoom-out | undo redo | bold italic | fontfamily fontsize forecolor | saveto | markers | node | switchlayout | help'
]
//只读模式,默认是false
//readOnly : false
//设置主题
//,defaultlayoutstyle : 'default' //设置默认的主题
......
//这里只放不是由模块产生的默认参数
KM.defaultOptions = {
zIndex : 1000,
lang:'zh-cn'
lang:'zh-cn',
readyOnly:false
};
\ No newline at end of file
......@@ -25,6 +25,10 @@ kity.extendClass( Minder, {
}
},
_firePharse: function ( e ) {
//只读模式下强了所有的事件操作
if(this.readOnly === true){
return false;
}
var beforeEvent, preEvent, executeEvent;
if ( e.type == 'DOMMouseScroll' ) {
......
......@@ -10,6 +10,9 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
this._initContextmenu();
this._initModules();
if(this.getOptions('readOnly') === true){
this.setDisabled();
}
this.fire( 'ready' );
},
getOptions: function ( key ) {
......@@ -166,6 +169,38 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
},
getStatus: function () {
return this._status;
},
setDisabled : function(){
var me = this;
//禁用命令
me.bkqueryCommandState = me.queryCommandState;
me.bkqueryCommandValue = me.queryCommandValue;
me.queryCommandState = function () {
return -1;
};
me.queryCommandValue = function () {
return null;
};
this.readOnly = true;
me.fire('interactchange');
},
setEnabled : function(){
var me = this;
if (me.bkqueryCommandState) {
me.queryCommandState = me.bkqueryCommandState;
delete me.bkqueryCommandState;
}
if (me.bkqueryCommandValue) {
me.queryCommandValue = me.bkqueryCommandValue;
delete me.bkqueryCommandValue;
}
this.readOnly = false;
me.fire('interactchange');
}
} );
......
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