| @@ 9443-9469 (lines=27) @@ | ||
| 9440 | var self$$1 = this; |
|
| 9441 | global$7(self$$1.getEl().lastChild).toggleClass(self$$1.classPrefix + 'active', state); |
|
| 9442 | }, |
|
| 9443 | renderHtml: function () { |
|
| 9444 | var self$$1 = this; |
|
| 9445 | var id = self$$1._id; |
|
| 9446 | var prefix = self$$1.classPrefix; |
|
| 9447 | var image; |
|
| 9448 | var icon = self$$1.state.get('icon'); |
|
| 9449 | var text = self$$1.state.get('text'); |
|
| 9450 | var settings = self$$1.settings; |
|
| 9451 | var textHtml = '', ariaPressed; |
|
| 9452 | image = settings.image; |
|
| 9453 | if (image) { |
|
| 9454 | icon = 'none'; |
|
| 9455 | if (typeof image !== 'string') { |
|
| 9456 | image = window.getSelection ? image[0] : image[1]; |
|
| 9457 | } |
|
| 9458 | image = ' style="background-image: url(\'' + image + '\')"'; |
|
| 9459 | } else { |
|
| 9460 | image = ''; |
|
| 9461 | } |
|
| 9462 | icon = settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : ''; |
|
| 9463 | if (text) { |
|
| 9464 | self$$1.classes.add('btn-has-text'); |
|
| 9465 | textHtml = '<span class="' + prefix + 'txt">' + self$$1.encode(text) + '</span>'; |
|
| 9466 | } |
|
| 9467 | ariaPressed = typeof settings.active === 'boolean' ? ' aria-pressed="' + settings.active + '"' : ''; |
|
| 9468 | return '<div id="' + id + '" class="' + self$$1.classes + '" role="button"' + ariaPressed + ' tabindex="-1">' + '<button type="button" hidefocus="1" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + textHtml + '</button>' + '<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' + (self$$1._menuBtnText ? (icon ? '\xA0' : '') + self$$1._menuBtnText : '') + ' <i class="' + prefix + 'caret"></i>' + '</button>' + '</div>'; |
|
| 9469 | }, |
|
| 9470 | postRender: function () { |
|
| 9471 | var self$$1 = this, onClickHandler = self$$1.settings.onclick; |
|
| 9472 | self$$1.on('click', function (e) { |
|
| @@ 9251-9277 (lines=27) @@ | ||
| 9248 | var self$$1 = this; |
|
| 9249 | global$9(self$$1.getEl().lastChild).toggleClass(self$$1.classPrefix + 'active', state); |
|
| 9250 | }, |
|
| 9251 | renderHtml: function () { |
|
| 9252 | var self$$1 = this; |
|
| 9253 | var id = self$$1._id; |
|
| 9254 | var prefix = self$$1.classPrefix; |
|
| 9255 | var image; |
|
| 9256 | var icon = self$$1.state.get('icon'); |
|
| 9257 | var text = self$$1.state.get('text'); |
|
| 9258 | var settings = self$$1.settings; |
|
| 9259 | var textHtml = '', ariaPressed; |
|
| 9260 | image = settings.image; |
|
| 9261 | if (image) { |
|
| 9262 | icon = 'none'; |
|
| 9263 | if (typeof image !== 'string') { |
|
| 9264 | image = window.getSelection ? image[0] : image[1]; |
|
| 9265 | } |
|
| 9266 | image = ' style="background-image: url(\'' + image + '\')"'; |
|
| 9267 | } else { |
|
| 9268 | image = ''; |
|
| 9269 | } |
|
| 9270 | icon = settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : ''; |
|
| 9271 | if (text) { |
|
| 9272 | self$$1.classes.add('btn-has-text'); |
|
| 9273 | textHtml = '<span class="' + prefix + 'txt">' + self$$1.encode(text) + '</span>'; |
|
| 9274 | } |
|
| 9275 | ariaPressed = typeof settings.active === 'boolean' ? ' aria-pressed="' + settings.active + '"' : ''; |
|
| 9276 | return '<div id="' + id + '" class="' + self$$1.classes + '" role="button"' + ariaPressed + ' tabindex="-1">' + '<button type="button" hidefocus="1" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + textHtml + '</button>' + '<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' + (self$$1._menuBtnText ? (icon ? '\xA0' : '') + self$$1._menuBtnText : '') + ' <i class="' + prefix + 'caret"></i>' + '</button>' + '</div>'; |
|
| 9277 | }, |
|
| 9278 | postRender: function () { |
|
| 9279 | var self$$1 = this, onClickHandler = self$$1.settings.onclick; |
|
| 9280 | self$$1.on('click', function (e) { |
|