Remove all actions before setting to prevent conflicts between old and new actions with the same id

This commit is contained in:
Nathan Gray 2015-04-08 22:41:44 +00:00
parent 894714c3f5
commit f926605ea7

View File

@ -1688,8 +1688,13 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput, et2_IPrin
set_actions: function(actions) { set_actions: function(actions) {
if(actions != this.options.actions && this.controller != null && this.controller._actionManager) if(actions != this.options.actions && this.controller != null && this.controller._actionManager)
{ {
for(var i = this.controller._actionManager.children.length - 1; i >= 0; i--)
{
this.controller._actionManager.children[i].remove();
}
this.options.actions = actions; this.options.actions = actions;
this.options.settings.action_links = this.controller._actionLinks = this._get_action_links(actions); this.options.settings.action_links = this.controller._actionLinks = this._get_action_links(actions);
this.controller._initActions(actions); this.controller._initActions(actions);
} }
}, },