[FIX] web_editor: snippet options were not working if not pure text
Some snippet options uses an image or icon as description instead of text (like the gradient option in some themes). Those were not working anymore as the user click was considered on the image/icon instead of the option itself. closes odoo/odoo#27807
This commit is contained in:
@@ -303,8 +303,8 @@ var SnippetOption = Widget.extend({
|
||||
* @param {Event} ev
|
||||
*/
|
||||
_onLinkEnter: function (ev) {
|
||||
var $opt = $(ev.target);
|
||||
if (!$opt.hasClass('dropdown-item')) {
|
||||
var $opt = $(ev.target).closest('.dropdown-item');
|
||||
if (!$opt.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -331,8 +331,8 @@ var SnippetOption = Widget.extend({
|
||||
* @param {Event} ev
|
||||
*/
|
||||
_onLinkClick: function (ev) {
|
||||
var $opt = $(ev.target);
|
||||
if (!$opt.hasClass('dropdown-item') || !$opt.is(':hasData')) {
|
||||
var $opt = $(ev.target).closest('.dropdown-item');
|
||||
if (!$opt.length || !$opt.is(':hasData')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user