[FIX] stringify states (patch from chs)

bzr revid: fme@openerp.com-20130220084437-cyb0pi8nw71bl5mx
This commit is contained in:
Fabien Meghazi 2013-02-20 09:44:37 +01:00
parent f559b97ce9
commit 364ea001f9
2 changed files with 6 additions and 5 deletions

View File

@ -1323,8 +1323,9 @@ instance.web.WebClient = instance.web.Client.extend({
},
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 @@ instance.web.WebClient = instance.web.Client.extend({
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);
},

View File

@ -195,7 +195,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
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(',');
}
}
}