mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-18 20:39:13 +02:00
Fix actions over grid always return the last row DOMNode, by passing DOMNode to et2_action_object_impl constructor for cases like the infamous loop problem (JS closure)
This commit is contained in:
@@ -704,12 +704,16 @@ var et2_surroundingsMgr = Class.extend(
|
|||||||
* The class extension is different than the widgets
|
* The class extension is different than the widgets
|
||||||
*
|
*
|
||||||
* @param {et2_DOMWidget} widget
|
* @param {et2_DOMWidget} widget
|
||||||
|
* @param {Object} node
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
function et2_action_object_impl(widget)
|
function et2_action_object_impl(widget, node)
|
||||||
{
|
{
|
||||||
var aoi = new egwActionObjectInterface();
|
var aoi = new egwActionObjectInterface();
|
||||||
|
var objectNode = node;
|
||||||
|
|
||||||
aoi.doGetDOMNode = function() {
|
aoi.doGetDOMNode = function() {
|
||||||
return widget.getDOMNode();
|
return objectNode?objectNode:widget.getDOMNode();
|
||||||
};
|
};
|
||||||
|
|
||||||
// _outerCall may be used to determine, whether the state change has been
|
// _outerCall may be used to determine, whether the state change has been
|
||||||
@@ -732,7 +736,7 @@ function et2_action_object_impl(widget)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
return aoi;
|
return aoi;
|
||||||
};
|
};
|
||||||
|
@@ -881,9 +881,9 @@ var et2_grid = et2_DOMWidget.extend([et2_IDetachedDOM, et2_IAligned],
|
|||||||
for(var i = 0; i < this.rowData.length; i++)
|
for(var i = 0; i < this.rowData.length; i++)
|
||||||
{
|
{
|
||||||
// Add a new action object to the object manager
|
// Add a new action object to the object manager
|
||||||
var aoi = new et2_action_object_impl(this);
|
|
||||||
var row = $j('tr', this.tbody)[i];
|
var row = $j('tr', this.tbody)[i];
|
||||||
aoi.doGetDOMNode = function() { return row;};
|
var aoi = new et2_action_object_impl(this, row);
|
||||||
|
|
||||||
var obj = widget_object.addObject("row_"+i, aoi);
|
var obj = widget_object.addObject("row_"+i, aoi);
|
||||||
obj.updateActionLinks(action_links);
|
obj.updateActionLinks(action_links);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user