diff --git a/mindplot/src/main/javascript/widget/Menu.js b/mindplot/src/main/javascript/widget/Menu.js index ce3c0974..bf2dd01e 100644 --- a/mindplot/src/main/javascript/widget/Menu.js +++ b/mindplot/src/main/javascript/widget/Menu.js @@ -323,13 +323,21 @@ mindplot.widget.Menu = new Class({ var rels = designer.getModel().filterSelectedRelations(); 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(); } - if (button.isRelAction() && rels.length == 0) { - button.disable(); - } + }) }.bind(this)); diff --git a/mindplot/src/main/javascript/widget/ToolbarItem.js b/mindplot/src/main/javascript/widget/ToolbarItem.js index 2f10f96a..583766d6 100644 --- a/mindplot/src/main/javascript/widget/ToolbarItem.js +++ b/mindplot/src/main/javascript/widget/ToolbarItem.js @@ -24,7 +24,6 @@ mindplot.widget.ToolbarItem = new Class({ this._buttonId = buttonId; this._fn = fn; this._options = options; - }, getButtonElem : function() { diff --git a/mindplot/src/main/javascript/widget/ToolbarPaneItem.js b/mindplot/src/main/javascript/widget/ToolbarPaneItem.js index 0c9f7531..bf563819 100644 --- a/mindplot/src/main/javascript/widget/ToolbarPaneItem.js +++ b/mindplot/src/main/javascript/widget/ToolbarPaneItem.js @@ -30,7 +30,7 @@ mindplot.widget.ToolbarPaneItem = new Class({ } }.bind(this); - this.parent(buttonId, fn, {topicAction:true,relAction:true}); + this.parent(buttonId, fn, {topicAction:true,relAction:false}); this._model = model; this._panelId = this._init().id; },