mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-17 02:41:02 +01:00
Fixed problem with getValues iterating over widgets which are in proxied templates
This commit is contained in:
parent
29c16431ad
commit
f9914e069c
@ -148,17 +148,8 @@ var et2_template = et2_DOMWidget.extend({
|
|||||||
return this.div;
|
return this.div;
|
||||||
},
|
},
|
||||||
|
|
||||||
getValues: function(_target) {
|
isInTree: function() {
|
||||||
if (this.proxiedTemplate)
|
return this._super(!this.isProxied);
|
||||||
{
|
|
||||||
return this.proxiedTemplate.getValues(_target);
|
|
||||||
}
|
|
||||||
else if (!this.isProxied)
|
|
||||||
{
|
|
||||||
return this._super(_target);
|
|
||||||
}
|
|
||||||
|
|
||||||
return _target;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -315,7 +315,7 @@ var et2_widget = Class.extend({
|
|||||||
_type = et2_widget;
|
_type = et2_widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.instanceOf(_type))
|
if (this.isInTree() && this.instanceOf(_type))
|
||||||
{
|
{
|
||||||
_callback.call(_context, this);
|
_callback.call(_context, this);
|
||||||
}
|
}
|
||||||
@ -326,6 +326,30 @@ var et2_widget = Class.extend({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the widget currently resides in the visible part of the
|
||||||
|
* widget tree. E.g. Templates which have been cloned are not in the visible
|
||||||
|
* part of the widget tree.
|
||||||
|
*
|
||||||
|
* @param _vis can be used by widgets overwriting this function - simply
|
||||||
|
* write
|
||||||
|
* return this._super(inTree);
|
||||||
|
* when calling this function the _vis parameter does not have to be supplied.
|
||||||
|
*/
|
||||||
|
isInTree: function(_vis) {
|
||||||
|
if (typeof _vis == "undefined")
|
||||||
|
{
|
||||||
|
_vis = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._parent)
|
||||||
|
{
|
||||||
|
return _vis && this._parent.isInTree();
|
||||||
|
}
|
||||||
|
|
||||||
|
return _vis;
|
||||||
|
},
|
||||||
|
|
||||||
isOfSupportedWidgetClass: function(_obj)
|
isOfSupportedWidgetClass: function(_obj)
|
||||||
{
|
{
|
||||||
for (var i = 0; i < this.supportedWidgetClasses.length; i++)
|
for (var i = 0; i < this.supportedWidgetClasses.length; i++)
|
||||||
@ -529,7 +553,7 @@ var et2_widget = Class.extend({
|
|||||||
// Check whether the entry is really undefined
|
// Check whether the entry is really undefined
|
||||||
if (typeof _target[_widget.id] != "undefined")
|
if (typeof _target[_widget.id] != "undefined")
|
||||||
{
|
{
|
||||||
et2_debug("error", "Overwriting value of '" + this.id +
|
et2_debug("error", "Overwriting value of '" + _widget.id +
|
||||||
"', id exists twice!");
|
"', id exists twice!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user