From 75d39c7f6a2565419c28bac4397678a6d60c5544 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 21 Feb 2012 17:29:12 +0100 Subject: [PATCH] [imp] renammed stop() bzr revid: nicolas.vanhoren@openerp.com-20120221162912-zheko30qoh84hcoq --- addons/web/static/src/js/chrome.js | 14 +++++----- addons/web/static/src/js/core.js | 8 +++--- addons/web/static/src/js/data_import.js | 8 +++--- addons/web/static/src/js/search.js | 14 +++++----- addons/web/static/src/js/view_editor.js | 4 +-- addons/web/static/src/js/view_form.js | 28 +++++++++---------- .../web/static/src/js/view_list_editable.js | 2 +- addons/web/static/src/js/views.js | 12 ++++---- addons/web_calendar/static/src/js/calendar.js | 2 +- .../web_dashboard/static/src/js/dashboard.js | 6 ++-- addons/web_graph/static/src/js/graph.js | 2 +- addons/web_kanban/static/src/js/kanban.js | 8 +++--- 12 files changed, 54 insertions(+), 54 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 9c145c95d05..060abeefc2c 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -148,7 +148,7 @@ openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog# on_resized: function() { //openerp.log("Dialog resized to %d x %d", this.$element.width(), this.$element.height()); }, - stop: function () { + destroy: function () { // Destroy widget this.close(); this.$element.dialog('destroy'); @@ -240,7 +240,7 @@ openerp.web.Loading = openerp.web.OldWidget.extend(/** @lends openerp.web.Loadin this.session.on_rpc_request.add_first(this.request_call); this.session.on_rpc_response.add_last(this.response_call); }, - stop: function() { + destroy: function() { this.session.on_rpc_request.remove(this.request_call); this.session.on_rpc_response.remove(this.response_call); this.on_rpc_event(-this.count); @@ -318,7 +318,7 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab self.hide(); }); }, - stop: function () { + destroy: function () { this.hide(); this.$option_id.empty(); @@ -383,7 +383,7 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab setTimeout(function () { self.getParent().do_login( info.db, admin.login, admin.password); - self.stop(); + self.destroy(); self.unblockUI(); }); }); @@ -799,7 +799,7 @@ openerp.web.Header = openerp.web.OldWidget.extend(/** @lends openerp.web.Header var inner_viewmanager = action_manager.inner_viewmanager; inner_viewmanager.views[inner_viewmanager.active_view].controller.do_save() .then(function() { - self.dialog.stop(); + self.dialog.destroy(); // needs to refresh interface in case language changed window.location.reload(); }); @@ -1101,7 +1101,7 @@ openerp.web.WebClient = openerp.web.OldWidget.extend(/** @lends openerp.web.WebC self.header.do_update(); self.menu.do_reload(); if(self.action_manager) - self.action_manager.stop(); + self.action_manager.destroy(); self.action_manager = new openerp.web.ActionManager(self); self.action_manager.appendTo($("#oe_app")); self.bind_hashchange(); @@ -1153,7 +1153,7 @@ openerp.web.WebClient = openerp.web.OldWidget.extend(/** @lends openerp.web.WebC }, destroy_content: function() { _.each(_.clone(this.getChildren()), function(el) { - el.stop(); + el.destroy(); }); this.$element.children().remove(); }, diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 992c7fef83c..63e0e2010c5 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -969,7 +969,7 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. * * And of course, when you don't need that widget anymore, just do: * - * my_widget.stop(); + * my_widget.destroy(); * * That will kill the widget in a clean way and erase its content from the dom. */ @@ -994,7 +994,7 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W * @extends openerp.web.CallbackEnabled * * @param {openerp.web.Widget} parent Binds the current instance to the given Widget instance. - * When that widget is destroyed by calling stop(), the current instance will be + * When that widget is destroyed by calling destroy(), the current instance will be * destroyed too. Can be null. * @param {String} element_id Deprecated. Sets the element_id. Only useful when you want * to bind the current Widget to an already existing part of the DOM, which is not compatible @@ -1035,9 +1035,9 @@ 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() { + destroy: function() { _.each(_.clone(this.getChildren()), function(el) { - el.stop(); + el.destroy(); }); if(this.$element != null) { this.$element.remove(); diff --git a/addons/web/static/src/js/data_import.js b/addons/web/static/src/js/data_import.js index e50f5a7b3db..3054a7784c4 100644 --- a/addons/web/static/src/js/data_import.js +++ b/addons/web/static/src/js/data_import.js @@ -66,11 +66,11 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ this._super(); this.open({ buttons: [ - {text: _t("Close"), click: function() { self.stop(); }}, + {text: _t("Close"), click: function() { self.destroy(); }}, {text: _t("Import File"), click: function() { self.do_import(); }, 'class': 'oe-dialog-import-button'} ], close: function(event, ui) { - self.stop(); + self.destroy(); } }); this.toggle_import_button(false); @@ -204,7 +204,7 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ if (this.getParent().getParent().active_view == "list") { this.getParent().reload_content(); } - this.stop(); + this.destroy(); return; } @@ -358,7 +358,7 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ } return true; }, - stop: function() { + destroy: function() { this.$element.remove(); this._super(); } diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 424d21f1d90..b57dd2e2302 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -552,7 +552,7 @@ openerp.web.search.Widget = openerp.web.OldWidget.extend( /** @lends openerp.web * "Stops" the widgets. Called when the view destroys itself, this * lets the widgets clean up after themselves. */ - stop: function () { + destroy: function () { delete this.view; this._super(); }, @@ -1159,7 +1159,7 @@ openerp.web.search.ExtendedSearchGroup = openerp.web.OldWidget.extend({ _this.add_prop(); }); this.$element.find('.searchview_extended_delete_group').click(function () { - _this.stop(); + _this.destroy(); }); }, get_domain: function() { @@ -1172,7 +1172,7 @@ openerp.web.search.ExtendedSearchGroup = openerp.web.OldWidget.extend({ _.map(_.range(_.max([0,props.length - 1])), function() { return op; }), props); }, - stop: function() { + destroy: function() { var parent = this.getParent(); if (this.getParent().getChildren().length == 1) this.getParent().hide(); @@ -1210,16 +1210,16 @@ openerp.web.search.ExtendedSearchProposition = openerp.web.OldWidget.extend(/** _this.changed(); }); this.$element.find('.searchview_extended_delete_prop').click(function () { - _this.stop(); + _this.destroy(); }); }, - stop: function() { + destroy: function() { var parent; if (this.getParent().getChildren().length == 1) parent = this.getParent(); this._super(); if (parent) - parent.stop(); + parent.destroy(); }, changed: function() { var nval = this.$element.find(".searchview_extended_prop_field").val(); @@ -1235,7 +1235,7 @@ openerp.web.search.ExtendedSearchProposition = openerp.web.OldWidget.extend(/** select_field: function(field) { var self = this; if(this.attrs.selected != null) { - this.value.stop(); + this.value.destroy(); this.value = null; this.$element.find('.searchview_extended_prop_op').html(''); } diff --git a/addons/web/static/src/js/view_editor.js b/addons/web/static/src/js/view_editor.js index 0258509f172..2c0dc3d70b4 100644 --- a/addons/web/static/src/js/view_editor.js +++ b/addons/web/static/src/js/view_editor.js @@ -1002,10 +1002,10 @@ openerp.web.ViewEditor = openerp.web.OldWidget.extend({ $.when(action_manager.do_action(action)).then(function() { var controller = action_manager.dialog_viewmanager.views['form'].controller; controller.on_button_cancel.add_last(function(){ - action_manager.stop() + action_manager.destroy() }); controller.do_save.add_last(function(){ - action_manager.stop(); + action_manager.destroy(); var value =controller.fields.name.value; self.add_node_dialog.$element.find('select[id=field_value]').append($("").attr("value",value).text(value)); _.detect(self.add_widget,function(widget){ diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index ad72bde16ee..17b9849cd42 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -74,13 +74,13 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# }, this.on_loaded); } }, - stop: function() { + destroy: function() { if (this.sidebar) { - this.sidebar.attachments.stop(); - this.sidebar.stop(); + this.sidebar.attachments.destroy(); + this.sidebar.destroy(); } _.each(this.widgets, function(w) { - w.stop(); + w.destroy(); }); this._super(); }, @@ -923,7 +923,7 @@ openerp.web.form.Widget = openerp.web.OldWidget.extend(/** @lends openerp.web.fo this.width = this.node.attrs.width; }, - stop: function() { + destroy: function() { this._super.apply(this, arguments); $.fn.tipsy.clear(); }, @@ -2554,7 +2554,7 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({ this.previous_readonly = this.readonly; if (this.viewmanager) { this.is_loaded = this.is_loaded.pipe(function() { - self.viewmanager.stop(); + self.viewmanager.destroy(); return $.when(self.load_views()).then(function() { self.reload_current_view(); }); @@ -2734,7 +2734,7 @@ openerp.web.form.FieldMany2Many = openerp.web.form.Field.extend({ this.previous_readonly = this.readonly; if (this.list_view) { this.is_loaded = this.is_loaded.pipe(function() { - self.list_view.stop(); + self.list_view.destroy(); return $.when(self.load_view()).then(function() { self.reload_content(); }); @@ -2866,7 +2866,7 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope setup_search_view: function(search_defaults) { var self = this; if (this.searchview) { - this.searchview.stop(); + this.searchview.destroy(); } this.searchview = new openerp.web.SearchView(this, this.dataset, false, search_defaults); @@ -2896,7 +2896,7 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope $buttons.prepend(QWeb.render("SelectCreatePopup.search.buttons")); var $cbutton = $buttons.find(".oe_selectcreatepopup-search-close"); $cbutton.click(function() { - self.stop(); + self.destroy(); }); var $sbutton = $buttons.find(".oe_selectcreatepopup-search-select"); if(self.options.disable_multiple_selection) { @@ -2904,7 +2904,7 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope } $sbutton.click(function() { self.on_select_elements(self.selected_ids); - self.stop(); + self.destroy(); }); }); }); @@ -2988,7 +2988,7 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope if (this.created_elements.length > 0) { this.on_select_elements(this.created_elements); } - this.stop(); + this.destroy(); }, on_default_get: function(res) {} }); @@ -2999,7 +2999,7 @@ openerp.web.form.SelectCreateListView = openerp.web.ListView.extend({ }, select_record: function(index) { this.popup.on_select_elements([this.dataset.ids[index]]); - this.popup.stop(); + this.popup.destroy(); }, do_select: function(ids, records) { this._super(ids, records); @@ -3075,12 +3075,12 @@ openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp var $nbutton = $buttons.find(".oe_formopenpopup-form-save"); $nbutton.click(function() { self.view_form.do_save().then(function() { - self.stop(); + self.destroy(); }); }); var $cbutton = $buttons.find(".oe_formopenpopup-form-close"); $cbutton.click(function() { - self.stop(); + self.destroy(); }); if (self.options.readonly) { $nbutton.hide(); diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 55f710d69ab..b8699bcc006 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -139,7 +139,7 @@ openerp.web.list_editable = function (openerp) { } cancelled.then(function () { self.view.unpad_columns(); - self.edition_form.stop(); + self.edition_form.destroy(); self.edition_form.$element.remove(); delete self.edition_form; delete self.edition_id; diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 3e5ae3b4c8e..08886ddfbe3 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -30,19 +30,19 @@ session.web.ActionManager = session.web.OldWidget.extend({ }, dialog_stop: function () { if (this.dialog) { - this.dialog_viewmanager.stop(); + this.dialog_viewmanager.destroy(); this.dialog_viewmanager = null; - this.dialog.stop(); + this.dialog.destroy(); this.dialog = null; } }, content_stop: function () { if (this.inner_viewmanager) { - this.inner_viewmanager.stop(); + this.inner_viewmanager.destroy(); this.inner_viewmanager = null; } if (this.client_widget) { - this.client_widget.stop(); + this.client_widget.destroy(); this.client_widget = null; } }, @@ -142,7 +142,7 @@ session.web.ActionManager = session.web.OldWidget.extend({ if(on_close) this.dialog.on_close.add(on_close); } else { - this.dialog_viewmanager.stop(); + this.dialog_viewmanager.destroy(); } this.dialog.dialog_title = action.name; this.dialog_viewmanager = new session.web.ViewManagerAction(this, action); @@ -385,7 +385,7 @@ session.web.ViewManager = session.web.OldWidget.extend(/** @lends session.web.V setup_search_view: function(view_id, search_defaults) { var self = this; if (this.searchview) { - this.searchview.stop(); + this.searchview.destroy(); } this.searchview = new session.web.SearchView( this, this.dataset, diff --git a/addons/web_calendar/static/src/js/calendar.js b/addons/web_calendar/static/src/js/calendar.js index 58e92d0b14a..14d76d5be7e 100644 --- a/addons/web_calendar/static/src/js/calendar.js +++ b/addons/web_calendar/static/src/js/calendar.js @@ -42,7 +42,7 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ this._super(); return this.rpc("/web/view/load", {"model": this.model, "view_id": this.view_id, "view_type":"calendar", 'toolbar': true}, this.on_loaded); }, - stop: function() { + destroy: function() { scheduler.clearAll(); this._super(); }, diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index 90bca6c0255..793ad651b81 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -240,7 +240,7 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({ do_reload: function() { var view_manager = this.view.getParent(), action_manager = view_manager.getParent(); - this.view.stop(); + this.view.destroy(); action_manager.do_action(view_manager.action); } }); @@ -463,8 +463,8 @@ openerp.web_dashboard.ApplicationInstaller = openerp.web.OldWidget.extend({ }); return r; }, - stop: function() { - this.action_manager.stop(); + destroy: function() { + this.action_manager.destroy(); return this._super(); } }); diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index ced4365d6ca..d962c7d6752 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -33,7 +33,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({ this.renderer = null; }, - stop: function () { + destroy: function () { if (this.renderer) { clearTimeout(this.renderer); } diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js index 49964ed611a..7cf73a58ff1 100644 --- a/addons/web_kanban/static/src/js/kanban.js +++ b/addons/web_kanban/static/src/js/kanban.js @@ -176,7 +176,7 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({ }, do_clear_groups: function() { _.each(this.groups, function(group) { - group.stop(); + group.destroy(); }); this.groups = []; this.$element.find('.oe_kanban_groups_headers, .oe_kanban_groups_records').empty(); @@ -327,7 +327,7 @@ openerp.web_kanban.KanbanGroup = openerp.web.OldWidget.extend({ this.$has_been_started.resolve(); return def; }, - stop: function() { + destroy: function() { this._super(); if (this.$records) { this.$records.remove(); @@ -469,7 +469,7 @@ openerp.web_kanban.KanbanRecord = openerp.web.OldWidget.extend({ if (confirm(_t("Are you sure you want to delete this record ?"))) { return $.when(this.view.dataset.unlink([this.id])).then(function() { self.group.remove_record(self.id); - self.stop(); + self.destroy(); }); } }, @@ -520,7 +520,7 @@ openerp.web_kanban.KanbanRecord = openerp.web.OldWidget.extend({ self.set_record(records[0]); self.do_render(); } else { - self.stop(); + self.destroy(); } }); },