[IMP] web_editor: clean buttons from icon toolbar

Some buttons/actions were unsuitable for icons (were made for images).
fa-icon for toggle icon spin was misleading ("refresh").

task#2737569

closes odoo/odoo#104163

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
Rodopho Cammarosano de Lima (rcdl)
2023-01-02 10:53:51 +01:00
parent ebfa84d8e3
commit e9dfb08021
2 changed files with 9 additions and 1 deletions
@@ -1874,6 +1874,14 @@ const Wysiwyg = Widget.extend({
// Some icons are relevant for icons, that aren't for other media.
this.toolbar.$el.find('#colorInputButtonGroup, #create-link').toggleClass('d-none', isInMedia && !$target.is('.fa'));
this.toolbar.$el.find('.only_fa').toggleClass('d-none', !$target.is('.fa'));
// Hide unsuitable buttons for icon
if ($target.is('.fa')) {
this.toolbar.$el.find([
'#image-shape',
'#image-width',
'#image-edit',
].join(',')).toggleClass('d-none', true);
}
// Hide the create-link button if the selection spans several blocks.
selection = this.odooEditor.document.getSelection();
const range = selection && selection.rangeCount && selection.getRangeAt(0);
+1 -1
View File
@@ -211,7 +211,7 @@
</div>
<div class="btn-group only_fa">
<div id="fa-spin" title="Toggle icon spin" class="editor-ignore btn fa fa-refresh"></div>
<div id="fa-spin" title="Toggle icon spin" class="editor-ignore btn fa fa-play"></div>
</div>
</div>
</t>