diff options
| author | Kevin Baptiste <kba@odoo.com> | 2019-08-12 07:18:23 +0000 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2019-11-28 10:05:12 +0000 |
| commit | ff1c35513aecef5fbc30f7c2f3834450e719714e (patch) | |
| tree | 8149f14df17095845e735d6cccaf9317a1f97af6 /addons/web/static/src/js/core | |
| parent | 4c030311ada2ad19a2ee81b15544b7aed35b642b (diff) | |
[IMP] web: update to fontawesome 4.7.0 to 5.11.2
FontAwesome 5 introduced new names for some icons as described on
https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#name-changes
This commit replaces the old names to the new ones.
closes odoo/odoo#35826
Taskid: 2050241
Related: odoo/enterprise#5180
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/core')
| -rw-r--r-- | addons/web/static/src/js/core/dom.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/web/static/src/js/core/dom.js b/addons/web/static/src/js/core/dom.js index a61caf480e4..56d889bce69 100644 --- a/addons/web/static/src/js/core/dom.js +++ b/addons/web/static/src/js/core/dom.js @@ -378,9 +378,12 @@ var dom = { var $button = $('<button/>', jQueryParams); if (options.icon) { - if (options.icon.substr(0, 3) === 'fa-') { + var isFontAwesome = options.icon.match(/(fa[brs]* )*(fa-(.+))/); + if (isFontAwesome) { + var faClass = (isFontAwesome[1] !== undefined ? isFontAwesome[1] : 'fas'); + var faIcon = isFontAwesome[2]; $button.append($('<i/>', { - class: 'fa fa-fw o_button_icon ' + options.icon, + class: faClass + ' fa-fw o_button_icon ' + faIcon })); } else { $button.append($('<img/>', { |
