[IMP] web_tree_many2one_clickable: Don't break keyboard navigation

pull/1576/head
Alexandre Díaz 2020-04-14 17:05:09 +02:00
parent 97fbb9de67
commit 80a0cbba19
2 changed files with 21 additions and 15 deletions

View File

@ -1,10 +1,17 @@
td.o_many2one_cell {
a {
margin-left: 0.5em;
visibility: hidden;
}
a {
color: $o-main-text-color !important;
&:hover {
color: $o-main-text-color !important;
}
&:hover a {
visibility: visible;
}
.many2one_clickable {
margin-left: 0.5em;
visibility: hidden;
}
}
&:hover a.many2one_clickable {
visibility: visible;
}
}

View File

@ -32,19 +32,18 @@ odoo.define('web_tree_many2one_clickable.many2one_clickable', function (require)
var self = this;
if (!this.noOpen && this.value) {
// Replace '<a>' element
this.$el.removeClass('o_form_uri');
this.$el = $('<span/>', {
html: this.$el.html(),
class: this.$el.attr('class') + ' o_field_text',
name: this.$el.attr('name'),
});
// Disable 'click' events
this.$el.off('click');
this.$el.on('click', function (ev) {
ev.preventDefault();
})
// Append button
var $a = $('<a/>', {
href: '#',
class: 'o_form_uri btn btn-sm btn-secondary' +
' fa fa-angle-double-right',
' fa fa-angle-double-right many2one_clickable',
tabindex: '-1',
}).on('click', function (ev) {
ev.preventDefault();
ev.stopPropagation();