From e4cf966222d3e9ed0db9406c6d2e7aa1faf30333 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 5 Apr 2024 16:55:17 +0300 Subject: [PATCH] [DE] Fix changing button's caption --- apps/common/main/lib/component/Button.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/common/main/lib/component/Button.js b/apps/common/main/lib/component/Button.js index bd95feb40c..de395441ac 100644 --- a/apps/common/main/lib/component/Button.js +++ b/apps/common/main/lib/component/Button.js @@ -898,9 +898,11 @@ define([ setCaption: function(caption) { if (this.caption != caption) { + var isHuge = false; if ( /icon-top/.test(this.options.cls) && !!this.caption && /huge/.test(this.options.cls) ) { var newCaption = this.getCaptionWithBreaks(caption); this.caption = newCaption || caption; + isHuge = true; } else this.caption = caption; @@ -908,7 +910,7 @@ define([ var captionNode = this.cmpEl.find('.caption'); if (captionNode.length > 0) { - captionNode.html((this.split || this.menu) ? _.template(templateBtnCaption)({caption: this.caption}) : this.caption); + captionNode.html(isHuge && (this.split || this.menu) ? _.template(templateBtnCaption)({caption: this.caption}) : this.caption); } else { this.cmpEl.find('button:first').addBack().filter('button').html(this.caption); }