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