From 4f205e20b90528d18568e05b59190ac7a9696ca9 Mon Sep 17 00:00:00 2001 From: volkirik <33526598+volkirik@users.noreply.github.com> Date: Fri, 15 Jun 2018 18:45:10 +0300 Subject: [PATCH 1/2] Update button.js Change tooltip when label changes --- ui/widgets/button.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/widgets/button.js b/ui/widgets/button.js index 42cfec06d2a..6b90820bbaf 100644 --- a/ui/widgets/button.js +++ b/ui/widgets/button.js @@ -238,8 +238,8 @@ $.widget( "ui.button", { // Make sure we can't end up with a button that has neither text nor icon if ( key === "showLabel" ) { - this._toggleClass( "ui-button-icon-only", null, !value ); - this._updateTooltip(); + this._toggleClass( "ui-button-icon-only", null, !value ); + this._updateTooltip(); } if ( key === "label" ) { @@ -255,6 +255,7 @@ $.widget( "ui.button", { this._attachIconSpace( this.options.iconPosition ); } } + this._updateTooltip(); } this._super( key, value ); From 7d0f6551a762db572805e6ec1d7278ced06374c4 Mon Sep 17 00:00:00 2001 From: volkirik <33526598+volkirik@users.noreply.github.com> Date: Fri, 15 Jun 2018 19:01:39 +0300 Subject: [PATCH 2/2] Update button.js update also button title if label changes --- ui/widgets/button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/widgets/button.js b/ui/widgets/button.js index 6b90820bbaf..7a5d6253d7c 100644 --- a/ui/widgets/button.js +++ b/ui/widgets/button.js @@ -255,7 +255,7 @@ $.widget( "ui.button", { this._attachIconSpace( this.options.iconPosition ); } } - this._updateTooltip(); + this.element.attr( "title", value ); } this._super( key, value );