forked from Techsystech/web
[FIX] web_tree_many2one_clickable: Compatible with decoration colors
parent
7be7fd5cff
commit
fe0fbf44f3
|
@ -1,15 +1,8 @@
|
|||
td.o_many2one_cell {
|
||||
a {
|
||||
color: $o-main-text-color !important;
|
||||
&:hover {
|
||||
color: $o-main-text-color !important;
|
||||
}
|
||||
|
||||
.many2one_clickable {
|
||||
margin-left: 0.5em;
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover a.many2one_clickable {
|
||||
visibility: visible;
|
||||
|
|
|
@ -32,11 +32,13 @@ odoo.define('web_tree_many2one_clickable.many2one_clickable', function (require)
|
|||
var self = this;
|
||||
|
||||
if (!this.noOpen && this.value) {
|
||||
// Disable 'click' events
|
||||
this.$el.off('click');
|
||||
this.$el.on('click', function (ev) {
|
||||
ev.preventDefault();
|
||||
})
|
||||
// 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"),
|
||||
});
|
||||
|
||||
// Append button
|
||||
var $a = $('<a/>', {
|
||||
|
@ -59,5 +61,12 @@ odoo.define('web_tree_many2one_clickable.many2one_clickable', function (require)
|
|||
this.$el.append($a);
|
||||
}
|
||||
},
|
||||
|
||||
getFocusableElement: function () {
|
||||
if (this.mode === 'readonly') {
|
||||
return $('');
|
||||
}
|
||||
return this._super.apply(this, arguments);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue