[IMP] factorise View.do_show do_hide
authorAntony Lesuisse <al@openerp.com>
Wed, 14 Dec 2011 17:18:11 +0000 (18:18 +0100)
committerAntony Lesuisse <al@openerp.com>
Wed, 14 Dec 2011 17:18:11 +0000 (18:18 +0100)
bzr revid: al@openerp.com-20111214171811-c4bka4nwylp3wn21

addons/web/static/src/js/view_form.js
addons/web/static/src/js/view_list.js
addons/web/static/src/js/views.js
addons/web_calendar/static/src/js/calendar.js
addons/web_diagram/static/src/js/diagram.js
addons/web_gantt/static/src/js/gantt.js
addons/web_graph/static/src/js/graph.js
addons/web_kanban/static/src/js/kanban.js

index 0ac70e6..7973229 100644 (file)
@@ -125,14 +125,14 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
         } else {
             promise = this.dataset.read_index(_.keys(this.fields_view.fields)).pipe(this.on_record_loaded);
         }
-        this.$element.show();
+        this._super();
         if (this.sidebar) {
             this.sidebar.$element.show();
         }
         return promise;
     },
     do_hide: function () {
-        this.$element.hide();
+        this._super();
         if (this.sidebar) {
             this.sidebar.$element.hide();
         }
index bf42343..ad25358 100644 (file)
@@ -402,13 +402,13 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
         }, this));
     },
     do_show: function () {
-        this.$element.show();
+        this._super();
         if (this.sidebar) {
             this.sidebar.$element.show();
         }
     },
     do_hide: function () {
-        this.$element.hide();
+        this._super();
         if (this.sidebar) {
             this.sidebar.$element.hide();
         }
index 116d7da..30b3cff 100644 (file)
@@ -1065,19 +1065,26 @@ session.web.View = session.web.Widget.extend(/** @lends session.web.View# */{
         this.embedded_view = embedded_view;
         this.options.sidebar = false;
     },
+    do_show: function () {
+        this.$element.show();
+    },
+    do_hide: function () {
+        this.$element.hide();
+    },
     /**
      * Switches to a specific view type
      *
      * @param {String} view view type to switch to
      */
-    do_switch_view: function(view) { },
+    do_switch_view: function(view) { 
+    },
     /**
      * Cancels the switch to the current view, switches to the previous one
      */
-    do_prev_view: function () { },
+    do_prev_view: function () { 
+    },
     do_search: function(view) {
     },
-
     set_common_sidebar_sections: function(sidebar) {
         sidebar.add_default_sections();
     },
@@ -1146,10 +1153,8 @@ session.web.View = session.web.Widget.extend(/** @lends session.web.View# */{
     sidebar_context: function () {
         return $.Deferred().resolve({}).promise();
     },
-
     do_push_state: function(state, overwrite) {
     },
-
     do_load_state: function(state) {
     }
 });
index aac3dcb..1e253fc 100644 (file)
@@ -394,7 +394,7 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({
         });
     },
     do_hide: function () {
-        this.$element.hide();
+        this._super();
         if (this.sidebar) {
             this.sidebar.$element.hide();
         }
index 08617ef..7c2619c 100644 (file)
@@ -298,14 +298,6 @@ openerp.web.DiagramView = openerp.web.View.extend({
         }
         $pager.find('span.oe_pager_index').html(index);
         $pager.find('span.oe_pager_count').html(this.dataset.count);
-    },
-
-    do_show: function () {
-        this.$element.show();
-    },
-
-    do_hide: function () {
-        this.$element.hide();
     }
 });
 };
index 71dba5d..ccf2ac0 100644 (file)
@@ -459,14 +459,6 @@ openerp.web_gantt.GanttView = openerp.web.View.extend({
         }
     },
 
-    do_show: function () {
-        this.$element.show();
-    },
-
-    do_hide: function () {
-        this.$element.hide();
-    },
-
     convert_str_date: function (str) {
         if (typeof str == 'string') {
             if (str.length == 19) {
index 6cf9998..acab0b7 100644 (file)
@@ -37,12 +37,6 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
         }
         this._super();
     },
-    do_show: function () {
-        this.$element.show();
-    },
-    do_hide: function () {
-        this.$element.hide();
-    },
     start: function() {
         var self = this;
         this._super();
index 84e1a34..0b67fdb 100644 (file)
@@ -258,12 +258,6 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
             });
         }
     },
-    do_show: function () {
-        this.$element.show();
-    },
-    do_hide: function () {
-        this.$element.hide();
-    },
     compute_groups_width: function() {
         var unfolded = 0;
         _.each(this.groups, function(group) {