From 2ecdb960d0d6b03fb9c3dcce7798458958a8cf49 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 21 Feb 2012 17:45:36 +0100 Subject: [PATCH] [imp] refactoring of ParentedMixin bzr revid: nicolas.vanhoren@openerp.com-20120221164536-zajw6gixwu4n4xgh --- addons/edi/static/src/js/edi.js | 4 ++-- addons/point_of_sale/static/src/js/pos.js | 4 ++-- addons/share/static/src/js/share.js | 4 ++-- addons/web_livechat/static/src/js/web_livechat.js | 2 +- addons/web_uservoice/static/src/js/web_uservoice.js | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/edi/static/src/js/edi.js b/addons/edi/static/src/js/edi.js index 0f59768bc4e..a93086bdcaa 100644 --- a/addons/edi/static/src/js/edi.js +++ b/addons/edi/static/src/js/edi.js @@ -142,8 +142,8 @@ openerp.edi.EdiImport = openerp.web.OldWidget.extend({ }, destroy_content: function() { - _.each(_.clone(this.widget_children), function(el) { - el.stop(); + _.each(_.clone(this.getChildren()), function(el) { + el.destroy(); }); this.$element.children().remove(); }, diff --git a/addons/point_of_sale/static/src/js/pos.js b/addons/point_of_sale/static/src/js/pos.js index 4c2c0fec15c..c2f150f04f3 100644 --- a/addons/point_of_sale/static/src/js/pos.js +++ b/addons/point_of_sale/static/src/js/pos.js @@ -1117,7 +1117,7 @@ openerp.point_of_sale = function(db) { this.order = options.order; this.shop = options.shop; this.order.bind('destroy', _.bind( function() { - return this.stop(); + this.destroy(); }, this)); this.shop.bind('change:selectedOrder', _.bind( function(shop) { var selectedOrder; @@ -1384,7 +1384,7 @@ openerp.point_of_sale = function(db) { }, this)); }, this)); }, - stop: function() { + destroy: function() { $('.oe_footer').show(); $('.oe_toggle_secondary_menu').show(); pos = undefined; diff --git a/addons/share/static/src/js/share.js b/addons/share/static/src/js/share.js index 05f45aaef42..a4dfba12e28 100644 --- a/addons/share/static/src/js/share.js +++ b/addons/share/static/src/js/share.js @@ -2,7 +2,7 @@ openerp.share = function(session) { function launch_wizard(self, view, user_type) { - var action = view.widget_parent.action; + var action = view.getParent().action; var Share = new session.web.DataSet(self, 'share.wizard', view.dataset.get_context()); var domain = new session.web.CompoundDomain(view.dataset.domain); if (view.fields_view.type == 'form') { @@ -57,7 +57,7 @@ session.web.Sidebar = session.web.Sidebar.extend({ }); }, on_sidebar_click_share: function(item) { - var view = this.widget_parent + var view = this.getParent() launch_wizard(this, view); }, }); diff --git a/addons/web_livechat/static/src/js/web_livechat.js b/addons/web_livechat/static/src/js/web_livechat.js index 6351ddb2d5c..4ddc93e3e6e 100644 --- a/addons/web_livechat/static/src/js/web_livechat.js +++ b/addons/web_livechat/static/src/js/web_livechat.js @@ -89,7 +89,7 @@ openerp.web.Header.include({ this._super(); this.update_promise.then(function() { if (self.livechat) { - self.livechat.stop(); + self.livechat.destroy(); } self.livechat = new openerp.web_livechat.Livechat(self); self.livechat.prependTo(self.$element.find('div.header_corner')); diff --git a/addons/web_uservoice/static/src/js/web_uservoice.js b/addons/web_uservoice/static/src/js/web_uservoice.js index b4b63584ca5..4871fb80c9d 100644 --- a/addons/web_uservoice/static/src/js/web_uservoice.js +++ b/addons/web_uservoice/static/src/js/web_uservoice.js @@ -71,7 +71,7 @@ instance.web.Header.include({ this._super(); this.update_promise.then(function() { if (self.uservoice) { - self.uservoice.stop(); + self.uservoice.destroy(); } self.uservoice = new instance.web_uservoice.UserVoice(self); self.uservoice.prependTo(self.$element.find('div.header_corner'));