[IMP] Improved pus/load state in diagram

bzr revid: fme@openerp.com-20121022083617-j1xuwhtywmxcqh3k
This commit is contained in:
Fabien Meghazi 2012-10-22 10:36:17 +02:00
commit 7dc44d561f
1 changed files with 16 additions and 1 deletions

View File

@ -117,12 +117,27 @@ instance.web.DiagramView = instance.web.View.extend({
on_diagram_loaded: function(record) {
var id_record = record['id'];
if(id_record) {
if (id_record) {
this.id = id_record;
this.get_diagram_info();
this.do_push_state({id: id_record});
} else {
this.do_push_state({});
}
},
do_load_state: function(state, warm) {
if (state && state.id) {
if (!this.dataset.get_id_index(state.id)) {
this.dataset.ids.push(state.id);
}
this.dataset.select_id(state.id);
if (warm) {
this.do_show();
}
}
},
// Set-up the drawing elements of the diagram
draw_diagram: function(result) {
var self = this;