Improve handling of changing actions in a nextmatch response:

- Also (re)set default action on new actions
- Avoid extra actionManagers
This commit is contained in:
Nathan Gray 2014-03-26 14:55:06 +00:00
parent 69fea7dc9c
commit 869bf62108
2 changed files with 5 additions and 2 deletions

View File

@ -1525,7 +1525,7 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput],
{
this.options.actions = actions;
this.options.settings.action_links = this.controller._actionLinks = this._get_action_links(actions);
this.controller._actionManager.updateActions(actions,this.controller.egw.appName);
this.controller._initActions(actions);
}
},

View File

@ -188,7 +188,10 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(et2_IDataProvider,
// Initialize the action manager and add some actions to it
// Only look 1 level deep
var gam = egw_getActionManager(this.egw.appName,true,1);
this._actionManager = gam.addAction("actionManager", uid);
if(this._actionManager == null)
{
this._actionManager = gam.addAction("actionManager", uid);
}
this._actionManager.updateActions(_actions, this.egw.appName);
var data = this._actionManager.data;
if (data == 'undefined' || !data)