| @@ 5070-5094 (lines=25) @@ | ||
| 5067 | } |
|
| 5068 | this._super(); |
|
| 5069 | }, |
|
| 5070 | renderHtml: function () { |
|
| 5071 | var self$$1 = this, id = self$$1._id, prefix = self$$1.classPrefix; |
|
| 5072 | var icon = self$$1.state.get('icon'), image; |
|
| 5073 | var text = self$$1.state.get('text'); |
|
| 5074 | var textHtml = ''; |
|
| 5075 | var ariaPressed; |
|
| 5076 | var settings = self$$1.settings; |
|
| 5077 | image = settings.image; |
|
| 5078 | if (image) { |
|
| 5079 | icon = 'none'; |
|
| 5080 | if (typeof image !== 'string') { |
|
| 5081 | image = window.getSelection ? image[0] : image[1]; |
|
| 5082 | } |
|
| 5083 | image = ' style="background-image: url(\'' + image + '\')"'; |
|
| 5084 | } else { |
|
| 5085 | image = ''; |
|
| 5086 | } |
|
| 5087 | if (text) { |
|
| 5088 | self$$1.classes.add('btn-has-text'); |
|
| 5089 | textHtml = '<span class="' + prefix + 'txt">' + self$$1.encode(text) + '</span>'; |
|
| 5090 | } |
|
| 5091 | icon = icon ? prefix + 'ico ' + prefix + 'i-' + icon : ''; |
|
| 5092 | ariaPressed = typeof settings.active === 'boolean' ? ' aria-pressed="' + settings.active + '"' : ''; |
|
| 5093 | return '<div id="' + id + '" class="' + self$$1.classes + '" tabindex="-1"' + ariaPressed + '>' + '<button id="' + id + '-button" role="presentation" type="button" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + textHtml + '</button>' + '</div>'; |
|
| 5094 | }, |
|
| 5095 | bindStates: function () { |
|
| 5096 | var self$$1 = this, $ = self$$1.$, textCls = self$$1.classPrefix + 'txt'; |
|
| 5097 | function setButtonText(text) { |
|
| @@ 4888-4912 (lines=25) @@ | ||
| 4885 | } |
|
| 4886 | this._super(); |
|
| 4887 | }, |
|
| 4888 | renderHtml: function () { |
|
| 4889 | var self$$1 = this, id = self$$1._id, prefix = self$$1.classPrefix; |
|
| 4890 | var icon = self$$1.state.get('icon'), image; |
|
| 4891 | var text = self$$1.state.get('text'); |
|
| 4892 | var textHtml = ''; |
|
| 4893 | var ariaPressed; |
|
| 4894 | var settings = self$$1.settings; |
|
| 4895 | image = settings.image; |
|
| 4896 | if (image) { |
|
| 4897 | icon = 'none'; |
|
| 4898 | if (typeof image !== 'string') { |
|
| 4899 | image = window.getSelection ? image[0] : image[1]; |
|
| 4900 | } |
|
| 4901 | image = ' style="background-image: url(\'' + image + '\')"'; |
|
| 4902 | } else { |
|
| 4903 | image = ''; |
|
| 4904 | } |
|
| 4905 | if (text) { |
|
| 4906 | self$$1.classes.add('btn-has-text'); |
|
| 4907 | textHtml = '<span class="' + prefix + 'txt">' + self$$1.encode(text) + '</span>'; |
|
| 4908 | } |
|
| 4909 | icon = icon ? prefix + 'ico ' + prefix + 'i-' + icon : ''; |
|
| 4910 | ariaPressed = typeof settings.active === 'boolean' ? ' aria-pressed="' + settings.active + '"' : ''; |
|
| 4911 | return '<div id="' + id + '" class="' + self$$1.classes + '" tabindex="-1"' + ariaPressed + '>' + '<button id="' + id + '-button" role="presentation" type="button" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + textHtml + '</button>' + '</div>'; |
|
| 4912 | }, |
|
| 4913 | bindStates: function () { |
|
| 4914 | var self$$1 = this, $ = self$$1.$, textCls = self$$1.classPrefix + 'txt'; |
|
| 4915 | function setButtonText(text) { |
|