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:58:06 +0100
committerniv-openerp <nicolas.vanhoren@openerp.com>2012-02-21 16:58:06 +0100
commit4ee34acbbec49b6de11b1ef0843b4e6605d60227 (patch)
treecf438113dc289c8fe823836a36025b9ff68be6c3 /addons/web/static/src/js/core.js
parent7fcfcbaddbea0da9c17eed388ef5d7af21b9e100 (diff)
[imp] cosmetic changes
bzr revid: nicolas.vanhoren@openerp.com-20120221155806-e6efydx5k7qtppdn
Diffstat (limited to 'addons/web/static/src/js/core.js')
-rw-r--r--addons/web/static/src/js/core.js32
1 files changed, 16 insertions, 16 deletions
diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js
index 9e9e01428ba..992c7fef83c 100644
--- a/addons/web/static/src/js/core.js
+++ b/addons/web/static/src/js/core.js
@@ -1029,10 +1029,23 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W
getChildren: function() {
return this.__parented_children || [];
},
- isStopped: function() {
+ isDestroyed: function() {
return this.__parented_stopped;
},
/**
+ * Destroys the current widget, also destroys all its children before destroying itself.
+ */
+ stop: function() {
+ _.each(_.clone(this.getChildren()), function(el) {
+ el.stop();
+ });
+ if(this.$element != null) {
+ this.$element.remove();
+ }
+ this.setParent(undefined);
+ this.__parented_stopped = true;
+ },
+ /**
* Renders the current widget and appends it to the given jQuery object or Widget.
*
* @param target A jQuery object or a Widget instance.
@@ -1123,19 +1136,6 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W
return $.Deferred().done().promise();
},
/**
- * Destroys the current widget, also destroys all its children before destroying itself.
- */
- stop: function() {
- _.each(_.clone(this.getChildren()), function(el) {
- el.stop();
- });
- if(this.$element != null) {
- this.$element.remove();
- }
- this.setParent(undefined);
- this.__parented_stopped = true;
- },
- /**
* Informs the action manager to do an action. This supposes that
* the action manager can be found amongst the ancestors of the current widget.
* If that's not the case this method will simply return `false`.
@@ -1163,10 +1163,10 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W
var def = $.Deferred().then(success, error);
var self = this;
openerp.connection.rpc(url, data). then(function() {
- if (!self.isStopped())
+ if (!self.isDestroyed())
def.resolve.apply(def, arguments);
}, function() {
- if (!self.isStopped())
+ if (!self.isDestroyed())
def.reject.apply(def, arguments);
});
return def.promise();