mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-26 07:44:56 +01:00
Minor fix.
This commit is contained in:
parent
9185883d30
commit
b0e5923fec
@ -323,13 +323,21 @@ mindplot.widget.Menu = new Class({
|
|||||||
var rels = designer.getModel().filterSelectedRelations();
|
var rels = designer.getModel().filterSelectedRelations();
|
||||||
|
|
||||||
this._toolbarElems.forEach(function(button) {
|
this._toolbarElems.forEach(function(button) {
|
||||||
if (button.isTopicAction() && topics.length == 0) {
|
var disable = false;
|
||||||
|
if (button.isTopicAction() && button.isRelAction()) {
|
||||||
|
disable = rels.length == 0 && topics.length == 0;
|
||||||
|
|
||||||
|
} else if (button.isTopicAction() && topics.length == 0) {
|
||||||
|
disable = true;
|
||||||
|
} else if (button.isRelAction() && rels.length == 0) {
|
||||||
|
disable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (disable) {
|
||||||
button.disable();
|
button.disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (button.isRelAction() && rels.length == 0) {
|
|
||||||
button.disable();
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ mindplot.widget.ToolbarItem = new Class({
|
|||||||
this._buttonId = buttonId;
|
this._buttonId = buttonId;
|
||||||
this._fn = fn;
|
this._fn = fn;
|
||||||
this._options = options;
|
this._options = options;
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getButtonElem : function() {
|
getButtonElem : function() {
|
||||||
|
@ -30,7 +30,7 @@ mindplot.widget.ToolbarPaneItem = new Class({
|
|||||||
}
|
}
|
||||||
|
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
this.parent(buttonId, fn, {topicAction:true,relAction:true});
|
this.parent(buttonId, fn, {topicAction:true,relAction:false});
|
||||||
this._model = model;
|
this._model = model;
|
||||||
this._panelId = this._init().id;
|
this._panelId = this._init().id;
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user