[IMP] handle url for list views
authorChristophe Simonis <chs@openerp.com>
Thu, 15 Dec 2011 15:31:34 +0000 (16:31 +0100)
committerChristophe Simonis <chs@openerp.com>
Thu, 15 Dec 2011 15:31:34 +0000 (16:31 +0100)
bzr revid: chs@openerp.com-20111215153134-tdwy5y8j7ktm1dzv

addons/web/static/src/js/view_list.js
addons/web/static/src/js/views.js

index f3aa9a6..8674984 100644 (file)
@@ -459,8 +459,32 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
                 self.compute_aggregates();
                 reloaded.resolve();
             }));
+        this.do_push_state({
+            page: this.page,
+            limit: this._limit,
+        });
         return reloaded.promise();
     },
+
+    do_load_state: function(state) {
+        var reload = false;
+        if (state.page && this.page !== state.page) {
+            this.page = state.page;
+            reload = true;
+        }
+        if (state.limit) {
+            if (_.isString(state.limit)) {
+                state.limit = null;
+            }
+            if (state.limit !== this._limit) {
+                this._limit = state.limit;
+                reload = true;
+            }
+        }
+        if (reload) {
+            this.reload_content();
+        }
+    },
     /**
      * Handler for the result of eval_domain_and_context, actually perform the
      * searching
index 76082f3..579027a 100644 (file)
@@ -1067,7 +1067,6 @@ session.web.View = session.web.Widget.extend(/** @lends session.web.View# */{
     },
     do_show: function () {
         this.$element.show();
-        this.do_push_state({});
     },
     do_hide: function () {
         this.$element.hide();