summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/core.js
diff options
context:
space:
mode:
authorniv-openerp <nicolas.vanhoren@openerp.com>2012-02-21 16:51:34 +0100
committerniv-openerp <nicolas.vanhoren@openerp.com>2012-02-21 16:51:34 +0100
commitbe66f62357f7cf0658a7c04b8cc41c15e38c55c8 (patch)
treecb1785addc85b0bf35d004a7565def28b16b048f /addons/web/static/src/js/core.js
parentcdd8489e4ca4c790cc4772ec1a6edbee4fe8136f (diff)
[imp] changed children
bzr revid: nicolas.vanhoren@openerp.com-20120221155134-lej2ren1troagr72
Diffstat (limited to 'addons/web/static/src/js/core.js')
-rw-r--r--addons/web/static/src/js/core.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js
index ca4d5f00781..d31d27b8fa4 100644
--- a/addons/web/static/src/js/core.js
+++ b/addons/web/static/src/js/core.js
@@ -1012,15 +1012,15 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W
setParent: function(parent) {
if(this.getParent()) {
if (this.getParent().__parented_mixin) {
- this.getParent().widget_children = _.without(this.getParent().widget_children, this);
+ this.getParent().__parented_children = _.without(this.getParent().getChildren(), this);
}
this.__parented_parent = undefined;
}
this.__parented_parent = parent;
if(parent && parent.__parented_mixin) {
- if (!parent.widget_children)
- parent.widget_children = [];
- parent.widget_children.push(this);
+ if (!parent.getChildren())
+ parent.__parented_children = [];
+ parent.getChildren().push(this);
}
// useful to know if the widget was destroyed and should not be used anymore
this.widget_is_stopped = false;
@@ -1028,6 +1028,9 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W
getParent: function() {
return this.__parented_parent;
},
+ getChildren: function() {
+ return this.__parented_children || [];
+ },
/**
* Renders the current widget and appends it to the given jQuery object or Widget.
*
@@ -1122,7 +1125,7 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W
* Destroys the current widget, also destroys all its children before destroying itself.
*/
stop: function() {
- _.each(_.clone(this.widget_children), function(el) {
+ _.each(_.clone(this.getChildren()), function(el) {
el.stop();
});
if(this.$element != null) {