diff options
| author | fat <[email protected]> | 2015-05-07 22:26:40 -0700 |
|---|---|---|
| committer | fat <[email protected]> | 2015-05-07 22:26:40 -0700 |
| commit | 1b183e2ff796fc22aba8a8cac074a306c083d018 (patch) | |
| tree | ecc5298aab8d67841e0a765e44feb0b70c872050 /js/src/button.js | |
| parent | 660505188241418ffda53b5eb848defecd5f57e1 (diff) | |
| download | bootstrap-1b183e2ff796fc22aba8a8cac074a306c083d018.tar.xz bootstrap-1b183e2ff796fc22aba8a8cac074a306c083d018.zip | |
carousel -> es6
Diffstat (limited to 'js/src/button.js')
| -rw-r--r-- | js/src/button.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/js/src/button.js b/js/src/button.js index 7e9344923..0f1dab2af 100644 --- a/js/src/button.js +++ b/js/src/button.js @@ -49,24 +49,24 @@ const Button = (($) => { class Button { constructor(element) { - this.element = element + this._element = element } // public toggle() { let triggerChangeEvent = true - let rootElement = $(this.element).closest( + let rootElement = $(this._element).closest( Selector.DATA_TOGGLE )[0] if (rootElement) { - let input = $(this.element).find(Selector.INPUT)[0] + let input = $(this._element).find(Selector.INPUT)[0] if (input) { if (input.type === 'radio') { if (input.checked && - $(this.element).hasClass(ClassName.ACTIVE)) { + $(this._element).hasClass(ClassName.ACTIVE)) { triggerChangeEvent = false } else { @@ -79,17 +79,17 @@ const Button = (($) => { } if (triggerChangeEvent) { - input.checked = !$(this.element).hasClass(ClassName.ACTIVE) - $(this.element).trigger('change') + input.checked = !$(this._element).hasClass(ClassName.ACTIVE) + $(this._element).trigger('change') } } } else { - this.element.setAttribute('aria-pressed', - !$(this.element).hasClass(ClassName.ACTIVE)) + this._element.setAttribute('aria-pressed', + !$(this._element).hasClass(ClassName.ACTIVE)) } if (triggerChangeEvent) { - $(this.element).toggleClass(ClassName.ACTIVE) + $(this._element).toggleClass(ClassName.ACTIVE) } } |
