changeset 14090d8afc0e in sao:5.4
details: https://hg.tryton.org/sao?cmd=changeset;node=14090d8afc0e
description:
        Do not override icons with text

        issue9388
        review325521002
        (grafted from 102ef3b3209de2f409a48d6738d0c63333b0adb9)
diffstat:

 src/tab.js    |   7 ++++---
 src/window.js |  30 ++++++++++++++++++------------
 2 files changed, 22 insertions(+), 15 deletions(-)

diffs (101 lines):

diff -r 6a756ccb27a8 -r 14090d8afc0e src/tab.js
--- a/src/tab.js        Wed Jun 03 21:02:49 2020 +0200
+++ b/src/tab.js        Fri Jun 05 19:12:53 2020 +0200
@@ -138,9 +138,10 @@
                         'role': 'menuitem',
                         'href': '#',
                         'tabindex': -1
-                    }).append(Sao.common.ICONFACTORY.get_icon_img(item.icon, {
-                        'aria-hidden': 'true',
-                    })).text(' ' + item.label).appendTo(menuitem);
+                    }).text(' ' + item.label).prepend(
+                        Sao.common.ICONFACTORY.get_icon_img(item.icon, {
+                            'aria-hidden': 'true',
+                        })).appendTo(menuitem);
                     this.menu_buttons[item.id] = menuitem;
                     link.click(function(evt) {
                         evt.preventDefault();
diff -r 6a756ccb27a8 -r 14090d8afc0e src/window.js
--- a/src/window.js     Wed Jun 03 21:02:49 2020 +0200
+++ b/src/window.js     Fri Jun 05 19:12:53 2020 +0200
@@ -954,31 +954,34 @@
             var button_add = jQuery('<button/>', {
                 'class': 'btn btn-default btn-block',
                 'type': 'button'
-            }).append(Sao.common.ICONFACTORY.get_icon_img('tryton-add')
+            }).text(' ' + Sao.i18n.gettext('Add')).prepend(
+                Sao.common.ICONFACTORY.get_icon_img('tryton-add')
             ).click(function(){
                 this.fields_all.find('.bg-primary').each(function(i, el_field) 
{
                     this.sig_sel_add(el_field);
                 }.bind(this));
-            }.bind(this)).text(' ' + Sao.i18n.gettext('Add'))
+            }.bind(this))
             .appendTo(this.column_buttons);
 
             jQuery('<button/>', {
                 'class': 'btn btn-default btn-block',
                 'type': 'button'
-            }).append(Sao.common.ICONFACTORY.get_icon_img('tryton-remove')
+            }).text(' ' + Sao.i18n.gettext('Remove')).prepend(
+                Sao.common.ICONFACTORY.get_icon_img('tryton-remove')
             ).click(function(){
                 // sig_unsel
                 this.fields_selected.children('li.bg-primary').remove();
-            }.bind(this)).text(' ' + Sao.i18n.gettext('Remove'))
+            }.bind(this))
             .appendTo(this.column_buttons);
 
             jQuery('<button/>', {
                 'class': 'btn btn-default btn-block',
                 'type': 'button'
-            }).append(Sao.common.ICONFACTORY.get_icon_img('tryton-clear')
+            }).text(' ' + Sao.i18n.gettext('Clear')).prepend(
+                Sao.common.ICONFACTORY.get_icon_img('tryton-clear')
             ).click(function(){
                 this.fields_selected.empty();
-            }.bind(this)).text(' ' + Sao.i18n.gettext('Clear'))
+            }.bind(this))
             .appendTo(this.column_buttons);
 
             jQuery('<hr>').appendTo(this.column_buttons);
@@ -1143,10 +1146,11 @@
             jQuery('<button/>', {
                 'class': 'btn btn-default btn-block',
                 'type': 'button'
-            }).append(Sao.common.ICONFACTORY.get_icon_img('tryton-search')
+            }).text(' ' + Sao.i18n.gettext('Auto-Detect')).prepend(
+                Sao.common.ICONFACTORY.get_icon_img('tryton-search')
             ).click(function(){
                 this.autodetect();
-            }.bind(this)).text(' ' + Sao.i18n.gettext('Auto-Detect'))
+            }.bind(this))
             .appendTo(this.column_buttons);
 
             var chooser_label = jQuery('<label/>', {
@@ -1438,19 +1442,21 @@
             jQuery('<button/>', {
                 'class': 'btn btn-default btn-block',
                 'type': 'button'
-            }).append(Sao.common.ICONFACTORY.get_icon_img('tryton-save')
+            }).text(' ' + Sao.i18n.gettext('Save Export')).prepend(
+                Sao.common.ICONFACTORY.get_icon_img('tryton-save')
             ).click(function(){
                 this.addreplace_predef();
-            }.bind(this)).text(' ' + Sao.i18n.gettext('Save Export'))
+            }.bind(this))
             .appendTo(this.column_buttons);
 
             jQuery('<button/>', {
                 'class': 'btn btn-default btn-block',
                 'type': 'button'
-            }).append(Sao.common.ICONFACTORY.get_icon_img('tryton-delete')
+            }).text(' ' + Sao.i18n.gettext('Delete Export')).prepend(
+                Sao.common.ICONFACTORY.get_icon_img('tryton-delete')
             ).click(function(){
                 this.remove_predef();
-            }.bind(this)).text(' ' + Sao.i18n.gettext('Delete Export'))
+            }.bind(this))
             .appendTo(this.column_buttons);
 
             var predefined_exports_column = jQuery('<div/>', {

Reply via email to