mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-10 09:36:35 +02:00
Persisting original styles of the passed element (we don't need to store null if there are no styles at all).
This commit is contained in:
parent
c04f637a3f
commit
c88f00513e
14
assets/scripts/dist/choices.js
vendored
14
assets/scripts/dist/choices.js
vendored
|
@ -352,8 +352,13 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
this.passedElement.classList.remove(this.config.classNames.input, this.config.classNames.hiddenState);
|
||||
this.passedElement.removeAttribute('tabindex');
|
||||
// restore original styles if any
|
||||
this.passedElement.setAttribute('style', this.passedElement.getAttribute('data-choices-js-orig-style'));
|
||||
this.passedElement.removeAttribute('data-choices-js-orig-style');
|
||||
var oldStyle = this.passedElement.getAttribute('data-choices-js-orig-style');
|
||||
if (Boolean(oldStyle)) {
|
||||
this.passedElement.removeAttribute('data-choices-js-orig-style');
|
||||
this.passedElement.setAttribute('style', oldStyle);
|
||||
} else {
|
||||
this.passedElement.removeAttribute('style');
|
||||
}
|
||||
this.passedElement.removeAttribute('aria-hidden');
|
||||
this.passedElement.removeAttribute('data-choice');
|
||||
|
||||
|
@ -2620,7 +2625,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
|
||||
this.passedElement.tabIndex = '-1';
|
||||
// persist original styles if any
|
||||
this.passedElement.setAttribute('data-choices-js-orig-style', this.passedElement.getAttribute('style'));
|
||||
var oldStyle = this.passedElement.getAttribute('style');
|
||||
if (Boolean(oldStyle)) {
|
||||
this.passedElement.setAttribute('data-choices-js-orig-style', oldStyle);
|
||||
}
|
||||
this.passedElement.setAttribute('style', 'display:none;');
|
||||
this.passedElement.setAttribute('aria-hidden', 'true');
|
||||
this.passedElement.setAttribute('data-choice', 'active');
|
||||
|
|
2
assets/scripts/dist/choices.js.map
vendored
2
assets/scripts/dist/choices.js.map
vendored
File diff suppressed because one or more lines are too long
6
assets/scripts/dist/choices.min.js
vendored
6
assets/scripts/dist/choices.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -282,8 +282,13 @@ class Choices {
|
|||
this.passedElement.classList.remove(this.config.classNames.input, this.config.classNames.hiddenState);
|
||||
this.passedElement.removeAttribute('tabindex');
|
||||
// restore original styles if any
|
||||
this.passedElement.setAttribute('style', this.passedElement.getAttribute('data-choices-js-orig-style'));
|
||||
this.passedElement.removeAttribute('data-choices-js-orig-style');
|
||||
const oldStyle = this.passedElement.getAttribute('data-choices-js-orig-style');
|
||||
if (Boolean(oldStyle)) {
|
||||
this.passedElement.removeAttribute('data-choices-js-orig-style');
|
||||
this.passedElement.setAttribute('style', oldStyle);
|
||||
} else {
|
||||
this.passedElement.removeAttribute('style');
|
||||
}
|
||||
this.passedElement.removeAttribute('aria-hidden');
|
||||
this.passedElement.removeAttribute('data-choice');
|
||||
|
||||
|
@ -2580,7 +2585,10 @@ class Choices {
|
|||
|
||||
this.passedElement.tabIndex = '-1';
|
||||
// persist original styles if any
|
||||
this.passedElement.setAttribute('data-choices-js-orig-style', this.passedElement.getAttribute('style'));
|
||||
const oldStyle = this.passedElement.getAttribute('style');
|
||||
if (Boolean(oldStyle)) {
|
||||
this.passedElement.setAttribute('data-choices-js-orig-style', oldStyle);
|
||||
}
|
||||
this.passedElement.setAttribute('style', 'display:none;');
|
||||
this.passedElement.setAttribute('aria-hidden', 'true');
|
||||
this.passedElement.setAttribute('data-choice', 'active');
|
||||
|
|
Loading…
Reference in a new issue