[FIX] web: correctly initialize view $containers

Problem could happen when clicking in views in dashboards.  The $container
was looked up depth first when the view is created, but in some case,
it is wrong (the correct order is actually breadth first).  A better way
to proceed is to get the reference when the view manager is created,
so we don't have the problem at all.
This commit is contained in:
Géry Debongnie
2015-01-30 16:24:51 +01:00
parent 7dfceb8f7e
commit 907c62f0ca
+2 -1
View File
@@ -630,6 +630,7 @@ instance.web.ViewManager = instance.web.Widget.extend({
action : self.action,
action_views_ids : views_ids,
}, self.flags, self.flags[view.type], view.options);
view.$container = self.$(".oe-view-manager-view-" + view.type);
// show options.$buttons as views will put their $buttons inside it
// and call show/hide on them
view.options.$buttons.show();
@@ -743,7 +744,7 @@ instance.web.ViewManager = instance.web.Widget.extend({
options.initial_mode = 'edit';
}
var controller = new View(this, this.dataset, view.view_id, options),
$container = this.$(".oe-view-manager-view-" + view.type + ":first");
$container = view.$container;
$container.hide();
view.controller = controller;