Persisting original styles of the passed element (built files).

This commit is contained in:
Maxim Mig 2017-07-15 00:37:35 +03:00
parent 8e8df3e455
commit c04f637a3f
3 changed files with 10 additions and 6 deletions

View file

@ -351,7 +351,9 @@ return /******/ (function(modules) { // webpackBootstrap
// Reinstate passed element
this.passedElement.classList.remove(this.config.classNames.input, this.config.classNames.hiddenState);
this.passedElement.removeAttribute('tabindex');
this.passedElement.removeAttribute('style');
// 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');
this.passedElement.removeAttribute('aria-hidden');
this.passedElement.removeAttribute('data-choice');
@ -1154,7 +1156,7 @@ return /******/ (function(modules) { // webpackBootstrap
/**
* Populate options via ajax callback
* @param {Function} fn Passed
* @param {Function} fn Function that actually makes an AJAX request
* @return {Object} Class instance
* @public
*/
@ -2617,6 +2619,8 @@ return /******/ (function(modules) { // webpackBootstrap
this.passedElement.classList.add(this.config.classNames.input, this.config.classNames.hiddenState);
this.passedElement.tabIndex = '-1';
// persist original styles if any
this.passedElement.setAttribute('data-choices-js-orig-style', this.passedElement.getAttribute('style'));
this.passedElement.setAttribute('style', 'display:none;');
this.passedElement.setAttribute('aria-hidden', 'true');
this.passedElement.setAttribute('data-choice', 'active');

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long