mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-26 04:41:41 +02:00
new "default_execute" attribute to set default onExecute for all actions
This commit is contained in:
parent
cda62917d8
commit
06ffa47c25
@ -69,6 +69,12 @@ var et2_DOMWidget = et2_widget.extend(et2_IDOMNode,
|
|||||||
"type": "any",
|
"type": "any",
|
||||||
"default": et2_no_init,
|
"default": et2_no_init,
|
||||||
"description": "List of egw actions that can be done on the widget. This includes context menu, drag and drop. TODO: Link to action documentation"
|
"description": "List of egw actions that can be done on the widget. This includes context menu, drag and drop. TODO: Link to action documentation"
|
||||||
|
},
|
||||||
|
default_execute: {
|
||||||
|
name: "Default onExecute for actions",
|
||||||
|
type: "js",
|
||||||
|
default: et2_no_init,
|
||||||
|
description: "Set default onExecute javascript method for action not specifying their own"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -426,6 +432,7 @@ var et2_DOMWidget = et2_widget.extend(et2_IDOMNode,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this._actionManager.updateActions(actions);
|
this._actionManager.updateActions(actions);
|
||||||
|
if (this.options.default_execute) this._actionManager.setDefaultExecute(this.options.default_execute);
|
||||||
|
|
||||||
// Put a reference to the widget into the action stuff, so we can
|
// Put a reference to the widget into the action stuff, so we can
|
||||||
// easily get back to widget context from the action handler
|
// easily get back to widget context from the action handler
|
||||||
@ -435,6 +442,13 @@ var et2_DOMWidget = et2_widget.extend(et2_IDOMNode,
|
|||||||
this._link_actions(actions);
|
this._link_actions(actions);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
set_default_execute: function(_default_execute)
|
||||||
|
{
|
||||||
|
this.options.default_execute = _default_execute;
|
||||||
|
|
||||||
|
if (this._actionManager) this._actionManager.setDefaultExecute(null, _default_execute);
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all action-links / id's of 1.-level actions from a given action object
|
* Get all action-links / id's of 1.-level actions from a given action object
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user