Skip to content

Instantly share code, notes, and snippets.

@KangOl
Created February 19, 2013 22:16
Show Gist options
  • Save KangOl/4990664 to your computer and use it in GitHub Desktop.
Save KangOl/4990664 to your computer and use it in GitHub Desktop.
=== modified file 'addons/web/static/src/js/chrome.js'
--- addons/web/static/src/js/chrome.js 2013-02-13 14:39:53 +0000
+++ addons/web/static/src/js/chrome.js 2013-02-19 22:08:07 +0000
@@ -1323,8 +1323,9 @@
},
on_hashchange: function(event) {
var self = this;
- var state = event.getState(true);
- if (!_.isEqual(this._current_state, state)) {
+ var stringstate = event.getState(false);
+ if (!_.isEqual(this._current_state, stringstate)) {
+ var state = event.getState(true);
if(!state.action && state.menu_id) {
self.menu.has_been_loaded.done(function() {
self.menu.do_reload().done(function() {
@@ -1336,13 +1337,13 @@
this.action_manager.do_load_state(state, !!this._current_state);
}
}
- this._current_state = state;
+ this._current_state = stringstate;
},
do_push_state: function(state) {
this.set_title(state.title);
delete state.title;
var url = '#' + $.param(state);
- this._current_state = _.clone(state);
+ this._current_state = $.deparam($.param(state), false); // stringify all values
$.bbq.pushState(url);
this.trigger('state_pushed', state);
},
=== modified file 'addons/web/static/src/js/views.js'
--- addons/web/static/src/js/views.js 2013-02-19 18:15:19 +0000
+++ addons/web/static/src/js/views.js 2013-02-19 22:09:42 +0000
@@ -195,7 +195,7 @@
state["active_id"] = this.inner_action.context.active_id;
}
if (this.inner_action.context.active_ids) {
- //state["active_ids"] = this.inner_action.context.active_ids.join(',');
+ state["active_ids"] = this.inner_action.context.active_ids.join(',');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment