summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/openerpframework.js
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2014-10-14 14:48:31 +0200
committerGéry Debongnie <ged@odoo.com>2014-10-21 09:33:52 +0200
commitd82ca918cd0f131959615150bba1930cb9c83fe5 (patch)
tree238dd5b8ec00bf6e1fe520c0cdfca35e93ae6f91 /addons/web/static/src/js/openerpframework.js
parentef636ed520852357241862b9e6ece7bb32c9e676 (diff)
[IMP] various code improvements
mostly styling, and related micro-changes
Diffstat (limited to 'addons/web/static/src/js/openerpframework.js')
-rw-r--r--addons/web/static/src/js/openerpframework.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/addons/web/static/src/js/openerpframework.js b/addons/web/static/src/js/openerpframework.js
index fd13bea49cb..b112783793f 100644
--- a/addons/web/static/src/js/openerpframework.js
+++ b/addons/web/static/src/js/openerpframework.js
@@ -287,7 +287,17 @@ openerp.ParentedMixin = {
});
this.setParent(undefined);
this.__parentedDestroyed = true;
- }
+ },
+ /**
+ * Find the closest ancestor matching predicate
+ */
+ findAncestor: function (predicate) {
+ var ancestor = this;
+ while (!(predicate(ancestor)) && ancestor && ancestor.getParent) {
+ ancestor = ancestor.getParent();
+ }
+ return ancestor;
+ },
};
/**