[IMP] numerical id => move to data-id, from @id. Also fixes active_id as string which failed to match the numerical id stored, and did not mark the toggler as 'to remove' when opening an action from the corresponding shortcut

bzr revid: xmo@openerp.com-20110816123724-2ti43xqeue3esx3x
This commit is contained in:
Xavier Morel
2011-08-16 14:37:24 +02:00
parent 1d5f8506c8
commit e74e307080
3 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -871,8 +871,9 @@ openerp.base.Header = openerp.base.Widget.extend({
.undelegate('li', 'click')
.delegate('li', 'click', function(e) {
e.stopPropagation();
self.session.active_id = this.id;
self.rpc('/base/menu/action', {'menu_id':this.id}, function(ir_menu_data) {
var id = $(this).data('id');
self.session.active_id = id;
self.rpc('/base/menu/action', {'menu_id':id}, function(ir_menu_data) {
if (ir_menu_data.action.length){
self.on_action(ir_menu_data.action[0][2]);
}
+1 -1
View File
@@ -381,7 +381,7 @@ openerp.base.ViewManagerAction = openerp.base.ViewManager.extend({
var dataset_shortcut = new openerp.base.DataSet(this, 'ir.ui.view_sc');
$shortcut_toggle.click(function() {
if ($shortcut_toggle.hasClass("oe-shortcut-remove")) {
var unlink_id = $(".oe-shortcuts li[id=" + self.session.active_id + "]").data('shortcut-id');
var unlink_id = $(".oe-shortcuts li[data-id=" + self.session.active_id + "]").data('shortcut-id');
dataset_shortcut.unlink([parseInt(unlink_id)]);
$shortcut_toggle.removeClass("oe-shortcut-remove");
} else {
+1 -1
View File
@@ -364,7 +364,7 @@
</t>
<ul t-name="Shortcuts">
<li t-foreach="shortcuts" t-as="shortcut"
t-att-id="shortcut.res_id"
t-att-data-id="shortcut.res_id"
t-att-data-shortcut-id="shortcut.id"
><t t-esc="shortcut.name"/></li>
</ul>