[FIX] web: fix actions in sidebar on second reload
When the user visited a view for the second time, the extra actions in the sidebar were broken. The reason is that the sidebar code modified in place the fields_view information. Note: This was not a problem before, because the field_view_get call was done each time the view was loaded, but now it is cached.
This commit is contained in:
@@ -103,13 +103,13 @@ var Sidebar = Widget.extend({
|
||||
_.each(['print','action','relate'], function(type) {
|
||||
var items = toolbar[type];
|
||||
if (items) {
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
items[i] = {
|
||||
label: items[i]['name'],
|
||||
action: items[i],
|
||||
var actions = _.map(items, function (item) {
|
||||
return {
|
||||
label: item.name,
|
||||
action: item,
|
||||
};
|
||||
}
|
||||
self.add_items(type=='print' ? 'print' : 'other', items);
|
||||
});
|
||||
self.add_items(type === 'print' ? 'print' : 'other', actions);
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -218,4 +218,3 @@ var Sidebar = Widget.extend({
|
||||
return Sidebar;
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user