|
@@ -1,5 +1,5 @@
|
|
|
/*!
|
|
|
- * Select2 4.0.8
|
|
|
+ * Select2 4.0.9
|
|
|
* https://select2.github.io
|
|
|
*
|
|
|
* Released under the MIT license
|
|
@@ -832,6 +832,8 @@ S2.define('select2/utils',[
|
|
|
if (Utils.__cache[id] != null) {
|
|
|
delete Utils.__cache[id];
|
|
|
}
|
|
|
+
|
|
|
+ element.removeAttribute('data-select2-id');
|
|
|
};
|
|
|
|
|
|
return Utils;
|
|
@@ -853,7 +855,7 @@ S2.define('select2/results',[
|
|
|
|
|
|
Results.prototype.render = function () {
|
|
|
var $results = $(
|
|
|
- '<ul class="select2-results__options" role="tree"></ul>'
|
|
|
+ '<ul class="select2-results__options" role="listbox"></ul>'
|
|
|
);
|
|
|
|
|
|
if (this.options.get('multiple')) {
|
|
@@ -876,7 +878,7 @@ S2.define('select2/results',[
|
|
|
this.hideLoading();
|
|
|
|
|
|
var $message = $(
|
|
|
- '<li role="treeitem" aria-live="assertive"' +
|
|
|
+ '<li role="alert" aria-live="assertive"' +
|
|
|
' class="select2-results__option"></li>'
|
|
|
);
|
|
|
|
|
@@ -1010,7 +1012,7 @@ S2.define('select2/results',[
|
|
|
option.className = 'select2-results__option';
|
|
|
|
|
|
var attrs = {
|
|
|
- 'role': 'treeitem',
|
|
|
+ 'role': 'option',
|
|
|
'aria-selected': 'false'
|
|
|
};
|
|
|
|
|
@@ -1430,6 +1432,7 @@ S2.define('select2/selection/base',[
|
|
|
|
|
|
$selection.attr('title', this.$element.attr('title'));
|
|
|
$selection.attr('tabindex', this._tabindex);
|
|
|
+ $selection.attr('aria-disabled', 'false');
|
|
|
|
|
|
this.$selection = $selection;
|
|
|
|
|
@@ -1439,7 +1442,6 @@ S2.define('select2/selection/base',[
|
|
|
BaseSelection.prototype.bind = function (container, $container) {
|
|
|
var self = this;
|
|
|
|
|
|
- var id = container.id + '-container';
|
|
|
var resultsId = container.id + '-results';
|
|
|
|
|
|
this.container = container;
|
|
@@ -1489,10 +1491,12 @@ S2.define('select2/selection/base',[
|
|
|
|
|
|
container.on('enable', function () {
|
|
|
self.$selection.attr('tabindex', self._tabindex);
|
|
|
+ self.$selection.attr('aria-disabled', 'false');
|
|
|
});
|
|
|
|
|
|
container.on('disable', function () {
|
|
|
self.$selection.attr('tabindex', '-1');
|
|
|
+ self.$selection.attr('aria-disabled', 'true');
|
|
|
});
|
|
|
};
|
|
|
|
|
@@ -1515,7 +1519,6 @@ S2.define('select2/selection/base',[
|
|
|
};
|
|
|
|
|
|
BaseSelection.prototype._attachCloseHandler = function (container) {
|
|
|
- var self = this;
|
|
|
|
|
|
$(document.body).on('mousedown.select2.' + container.id, function (e) {
|
|
|
var $target = $(e.target);
|
|
@@ -1525,8 +1528,6 @@ S2.define('select2/selection/base',[
|
|
|
var $all = $('.select2.select2-container--open');
|
|
|
|
|
|
$all.each(function () {
|
|
|
- var $this = $(this);
|
|
|
-
|
|
|
if (this == $select[0]) {
|
|
|
return;
|
|
|
}
|
|
@@ -1653,7 +1654,14 @@ S2.define('select2/selection/single',[
|
|
|
var formatted = this.display(selection, $rendered);
|
|
|
|
|
|
$rendered.empty().append(formatted);
|
|
|
- $rendered.attr('title', selection.title || selection.text);
|
|
|
+
|
|
|
+ var title = selection.title || selection.text;
|
|
|
+
|
|
|
+ if (title) {
|
|
|
+ $rendered.attr('title', title);
|
|
|
+ } else {
|
|
|
+ $rendered.removeAttr('title');
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
return SingleSelection;
|
|
@@ -1756,7 +1764,12 @@ S2.define('select2/selection/multiple',[
|
|
|
var formatted = this.display(selection, $selection);
|
|
|
|
|
|
$selection.append(formatted);
|
|
|
- $selection.attr('title', selection.title || selection.text);
|
|
|
+
|
|
|
+ var title = selection.title || selection.text;
|
|
|
+
|
|
|
+ if (title) {
|
|
|
+ $selection.attr('title', title);
|
|
|
+ }
|
|
|
|
|
|
Utils.StoreData($selection[0], 'data', selection);
|
|
|
|
|
@@ -1949,7 +1962,7 @@ S2.define('select2/selection/search',[
|
|
|
'<li class="select2-search select2-search--inline">' +
|
|
|
'<input class="select2-search__field" type="search" tabindex="-1"' +
|
|
|
' autocomplete="off" autocorrect="off" autocapitalize="none"' +
|
|
|
- ' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
|
|
|
+ ' spellcheck="false" role="searchbox" aria-autocomplete="list" />' +
|
|
|
'</li>'
|
|
|
);
|
|
|
|
|
@@ -1966,14 +1979,18 @@ S2.define('select2/selection/search',[
|
|
|
Search.prototype.bind = function (decorated, container, $container) {
|
|
|
var self = this;
|
|
|
|
|
|
+ var resultsId = container.id + '-results';
|
|
|
+
|
|
|
decorated.call(this, container, $container);
|
|
|
|
|
|
container.on('open', function () {
|
|
|
+ self.$search.attr('aria-controls', resultsId);
|
|
|
self.$search.trigger('focus');
|
|
|
});
|
|
|
|
|
|
container.on('close', function () {
|
|
|
self.$search.val('');
|
|
|
+ self.$search.removeAttr('aria-controls');
|
|
|
self.$search.removeAttr('aria-activedescendant');
|
|
|
self.$search.trigger('focus');
|
|
|
});
|
|
@@ -1993,7 +2010,11 @@ S2.define('select2/selection/search',[
|
|
|
});
|
|
|
|
|
|
container.on('results:focus', function (params) {
|
|
|
- self.$search.attr('aria-activedescendant', params.id);
|
|
|
+ if (params.data._resultId) {
|
|
|
+ self.$search.attr('aria-activedescendant', params.data._resultId);
|
|
|
+ } else {
|
|
|
+ self.$search.removeAttr('aria-activedescendant');
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
this.$selection.on('focusin', '.select2-search--inline', function (evt) {
|
|
@@ -2027,6 +2048,12 @@ S2.define('select2/selection/search',[
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ this.$selection.on('click', '.select2-search--inline', function (evt) {
|
|
|
+ if (self.$search.val()) {
|
|
|
+ evt.stopPropagation();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
// Try to detect the IE version should the `documentMode` property that
|
|
|
// is stored on the document. This is only implemented in IE and is
|
|
|
// slightly cleaner than doing a user agent check.
|
|
@@ -2145,7 +2172,7 @@ S2.define('select2/selection/search',[
|
|
|
var width = '';
|
|
|
|
|
|
if (this.$search.attr('placeholder') !== '') {
|
|
|
- width = this.$selection.find('.select2-selection__rendered').innerWidth();
|
|
|
+ width = this.$selection.find('.select2-selection__rendered').width();
|
|
|
} else {
|
|
|
var minimumWidth = this.$search.val().length + 1;
|
|
|
|
|
@@ -3428,15 +3455,19 @@ S2.define('select2/data/array',[
|
|
|
'jquery'
|
|
|
], function (SelectAdapter, Utils, $) {
|
|
|
function ArrayAdapter ($element, options) {
|
|
|
- var data = options.get('data') || [];
|
|
|
+ this._dataToConvert = options.get('data') || [];
|
|
|
|
|
|
ArrayAdapter.__super__.constructor.call(this, $element, options);
|
|
|
-
|
|
|
- this.addOptions(this.convertToOptions(data));
|
|
|
}
|
|
|
|
|
|
Utils.Extend(ArrayAdapter, SelectAdapter);
|
|
|
|
|
|
+ ArrayAdapter.prototype.bind = function (container, $container) {
|
|
|
+ ArrayAdapter.__super__.bind.call(this, container, $container);
|
|
|
+
|
|
|
+ this.addOptions(this.convertToOptions(this._dataToConvert));
|
|
|
+ };
|
|
|
+
|
|
|
ArrayAdapter.prototype.select = function (data) {
|
|
|
var $option = this.$element.find('option').filter(function (i, elm) {
|
|
|
return elm.value == data.id.toString();
|
|
@@ -3726,8 +3757,6 @@ S2.define('select2/data/tags',[
|
|
|
};
|
|
|
|
|
|
Tags.prototype._removeOldTags = function (_) {
|
|
|
- var tag = this._lastTag;
|
|
|
-
|
|
|
var $options = this.$element.find('option[data-select2-tag]');
|
|
|
|
|
|
$options.each(function () {
|
|
@@ -3931,10 +3960,30 @@ S2.define('select2/data/maximumSelectionLength',[
|
|
|
decorated.call(this, $e, options);
|
|
|
}
|
|
|
|
|
|
+ MaximumSelectionLength.prototype.bind =
|
|
|
+ function (decorated, container, $container) {
|
|
|
+ var self = this;
|
|
|
+
|
|
|
+ decorated.call(this, container, $container);
|
|
|
+
|
|
|
+ container.on('select', function () {
|
|
|
+ self._checkIfMaximumSelected();
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
MaximumSelectionLength.prototype.query =
|
|
|
function (decorated, params, callback) {
|
|
|
var self = this;
|
|
|
|
|
|
+ this._checkIfMaximumSelected(function () {
|
|
|
+ decorated.call(self, params, callback);
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ MaximumSelectionLength.prototype._checkIfMaximumSelected =
|
|
|
+ function (_, successCallback) {
|
|
|
+ var self = this;
|
|
|
+
|
|
|
this.current(function (currentData) {
|
|
|
var count = currentData != null ? currentData.length : 0;
|
|
|
if (self.maximumSelectionLength > 0 &&
|
|
@@ -3947,7 +3996,10 @@ S2.define('select2/data/maximumSelectionLength',[
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- decorated.call(self, params, callback);
|
|
|
+
|
|
|
+ if (successCallback) {
|
|
|
+ successCallback();
|
|
|
+ }
|
|
|
});
|
|
|
};
|
|
|
|
|
@@ -4010,7 +4062,7 @@ S2.define('select2/dropdown/search',[
|
|
|
'<span class="select2-search select2-search--dropdown">' +
|
|
|
'<input class="select2-search__field" type="search" tabindex="-1"' +
|
|
|
' autocomplete="off" autocorrect="off" autocapitalize="none"' +
|
|
|
- ' spellcheck="false" role="textbox" />' +
|
|
|
+ ' spellcheck="false" role="searchbox" aria-autocomplete="list" />' +
|
|
|
'</span>'
|
|
|
);
|
|
|
|
|
@@ -4025,6 +4077,8 @@ S2.define('select2/dropdown/search',[
|
|
|
Search.prototype.bind = function (decorated, container, $container) {
|
|
|
var self = this;
|
|
|
|
|
|
+ var resultsId = container.id + '-results';
|
|
|
+
|
|
|
decorated.call(this, container, $container);
|
|
|
|
|
|
this.$search.on('keydown', function (evt) {
|
|
@@ -4047,6 +4101,7 @@ S2.define('select2/dropdown/search',[
|
|
|
|
|
|
container.on('open', function () {
|
|
|
self.$search.attr('tabindex', 0);
|
|
|
+ self.$search.attr('aria-controls', resultsId);
|
|
|
|
|
|
self.$search.trigger('focus');
|
|
|
|
|
@@ -4057,6 +4112,8 @@ S2.define('select2/dropdown/search',[
|
|
|
|
|
|
container.on('close', function () {
|
|
|
self.$search.attr('tabindex', -1);
|
|
|
+ self.$search.removeAttr('aria-controls');
|
|
|
+ self.$search.removeAttr('aria-activedescendant');
|
|
|
|
|
|
self.$search.val('');
|
|
|
self.$search.trigger('blur');
|
|
@@ -4079,6 +4136,14 @@ S2.define('select2/dropdown/search',[
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ container.on('results:focus', function (params) {
|
|
|
+ if (params.data._resultId) {
|
|
|
+ self.$search.attr('aria-activedescendant', params.data._resultId);
|
|
|
+ } else {
|
|
|
+ self.$search.removeAttr('aria-activedescendant');
|
|
|
+ }
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
Search.prototype.handleSearch = function (evt) {
|
|
@@ -4223,7 +4288,7 @@ S2.define('select2/dropdown/infiniteScroll',[
|
|
|
var $option = $(
|
|
|
'<li ' +
|
|
|
'class="select2-results__option select2-results__option--load-more"' +
|
|
|
- 'role="treeitem" aria-disabled="true"></li>'
|
|
|
+ 'role="option" aria-disabled="true"></li>'
|
|
|
);
|
|
|
|
|
|
var message = this.options.get('translations').get('loadingMore');
|
|
@@ -4249,27 +4314,11 @@ S2.define('select2/dropdown/attachBody',[
|
|
|
AttachBody.prototype.bind = function (decorated, container, $container) {
|
|
|
var self = this;
|
|
|
|
|
|
- var setupResultsEvents = false;
|
|
|
-
|
|
|
decorated.call(this, container, $container);
|
|
|
|
|
|
container.on('open', function () {
|
|
|
self._showDropdown();
|
|
|
self._attachPositioningHandler(container);
|
|
|
-
|
|
|
- if (!setupResultsEvents) {
|
|
|
- setupResultsEvents = true;
|
|
|
-
|
|
|
- container.on('results:all', function () {
|
|
|
- self._positionDropdown();
|
|
|
- self._resizeDropdown();
|
|
|
- });
|
|
|
-
|
|
|
- container.on('results:append', function () {
|
|
|
- self._positionDropdown();
|
|
|
- self._resizeDropdown();
|
|
|
- });
|
|
|
- }
|
|
|
});
|
|
|
|
|
|
container.on('close', function () {
|
|
@@ -4277,6 +4326,31 @@ S2.define('select2/dropdown/attachBody',[
|
|
|
self._detachPositioningHandler(container);
|
|
|
});
|
|
|
|
|
|
+ container.on('results:all', function () {
|
|
|
+ self._positionDropdown();
|
|
|
+ self._resizeDropdown();
|
|
|
+ });
|
|
|
+
|
|
|
+ container.on('results:append', function () {
|
|
|
+ self._positionDropdown();
|
|
|
+ self._resizeDropdown();
|
|
|
+ });
|
|
|
+
|
|
|
+ container.on('results:message', function () {
|
|
|
+ self._positionDropdown();
|
|
|
+ self._resizeDropdown();
|
|
|
+ });
|
|
|
+
|
|
|
+ container.on('select', function () {
|
|
|
+ self._positionDropdown();
|
|
|
+ self._resizeDropdown();
|
|
|
+ });
|
|
|
+
|
|
|
+ container.on('unselect', function () {
|
|
|
+ self._positionDropdown();
|
|
|
+ self._resizeDropdown();
|
|
|
+ });
|
|
|
+
|
|
|
this.$dropdownContainer.on('mousedown', function (evt) {
|
|
|
evt.stopPropagation();
|
|
|
});
|
|
@@ -4868,66 +4942,29 @@ S2.define('select2/defaults',[
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- if (typeof options.language === 'string') {
|
|
|
- // Check if the language is specified with a region
|
|
|
- if (options.language.indexOf('-') > 0) {
|
|
|
- // Extract the region information if it is included
|
|
|
- var languageParts = options.language.split('-');
|
|
|
- var baseLanguage = languageParts[0];
|
|
|
-
|
|
|
- options.language = [options.language, baseLanguage];
|
|
|
- } else {
|
|
|
- options.language = [options.language];
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if ($.isArray(options.language)) {
|
|
|
- var languages = new Translation();
|
|
|
- options.language.push('en');
|
|
|
+ // If the defaults were not previously applied from an element, it is
|
|
|
+ // possible for the language option to have not been resolved
|
|
|
+ options.language = this._resolveLanguage(options.language);
|
|
|
|
|
|
- var languageNames = options.language;
|
|
|
+ // Always fall back to English since it will always be complete
|
|
|
+ options.language.push('en');
|
|
|
|
|
|
- for (var l = 0; l < languageNames.length; l++) {
|
|
|
- var name = languageNames[l];
|
|
|
- var language = {};
|
|
|
-
|
|
|
- try {
|
|
|
- // Try to load it with the original name
|
|
|
- language = Translation.loadPath(name);
|
|
|
- } catch (e) {
|
|
|
- try {
|
|
|
- // If we couldn't load it, check if it wasn't the full path
|
|
|
- name = this.defaults.amdLanguageBase + name;
|
|
|
- language = Translation.loadPath(name);
|
|
|
- } catch (ex) {
|
|
|
- // The translation could not be loaded at all. Sometimes this is
|
|
|
- // because of a configuration problem, other times this can be
|
|
|
- // because of how Select2 helps load all possible translation files.
|
|
|
- if (options.debug && window.console && console.warn) {
|
|
|
- console.warn(
|
|
|
- 'Select2: The language file for "' + name + '" could not be ' +
|
|
|
- 'automatically loaded. A fallback will be used instead.'
|
|
|
- );
|
|
|
- }
|
|
|
+ var uniqueLanguages = [];
|
|
|
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
+ for (var l = 0; l < options.language.length; l++) {
|
|
|
+ var language = options.language[l];
|
|
|
|
|
|
- languages.extend(language);
|
|
|
+ if (uniqueLanguages.indexOf(language) === -1) {
|
|
|
+ uniqueLanguages.push(language);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- options.translations = languages;
|
|
|
- } else {
|
|
|
- var baseTranslation = Translation.loadPath(
|
|
|
- this.defaults.amdLanguageBase + 'en'
|
|
|
- );
|
|
|
- var customTranslation = new Translation(options.language);
|
|
|
-
|
|
|
- customTranslation.extend(baseTranslation);
|
|
|
+ options.language = uniqueLanguages;
|
|
|
|
|
|
- options.translations = customTranslation;
|
|
|
- }
|
|
|
+ options.translations = this._processTranslations(
|
|
|
+ options.language,
|
|
|
+ options.debug
|
|
|
+ );
|
|
|
|
|
|
return options;
|
|
|
};
|
|
@@ -4994,7 +5031,7 @@ S2.define('select2/defaults',[
|
|
|
debug: false,
|
|
|
dropdownAutoWidth: false,
|
|
|
escapeMarkup: Utils.escapeMarkup,
|
|
|
- language: EnglishTranslation,
|
|
|
+ language: {},
|
|
|
matcher: matcher,
|
|
|
minimumInputLength: 0,
|
|
|
maximumInputLength: 0,
|
|
@@ -5016,6 +5053,103 @@ S2.define('select2/defaults',[
|
|
|
};
|
|
|
};
|
|
|
|
|
|
+ Defaults.prototype.applyFromElement = function (options, $element) {
|
|
|
+ var optionLanguage = options.language;
|
|
|
+ var defaultLanguage = this.defaults.language;
|
|
|
+ var elementLanguage = $element.prop('lang');
|
|
|
+ var parentLanguage = $element.closest('[lang]').prop('lang');
|
|
|
+
|
|
|
+ var languages = Array.prototype.concat.call(
|
|
|
+ this._resolveLanguage(elementLanguage),
|
|
|
+ this._resolveLanguage(optionLanguage),
|
|
|
+ this._resolveLanguage(defaultLanguage),
|
|
|
+ this._resolveLanguage(parentLanguage)
|
|
|
+ );
|
|
|
+
|
|
|
+ options.language = languages;
|
|
|
+
|
|
|
+ return options;
|
|
|
+ };
|
|
|
+
|
|
|
+ Defaults.prototype._resolveLanguage = function (language) {
|
|
|
+ if (!language) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($.isEmptyObject(language)) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($.isPlainObject(language)) {
|
|
|
+ return [language];
|
|
|
+ }
|
|
|
+
|
|
|
+ var languages;
|
|
|
+
|
|
|
+ if (!$.isArray(language)) {
|
|
|
+ languages = [language];
|
|
|
+ } else {
|
|
|
+ languages = language;
|
|
|
+ }
|
|
|
+
|
|
|
+ var resolvedLanguages = [];
|
|
|
+
|
|
|
+ for (var l = 0; l < languages.length; l++) {
|
|
|
+ resolvedLanguages.push(languages[l]);
|
|
|
+
|
|
|
+ if (typeof languages[l] === 'string' && languages[l].indexOf('-') > 0) {
|
|
|
+ // Extract the region information if it is included
|
|
|
+ var languageParts = languages[l].split('-');
|
|
|
+ var baseLanguage = languageParts[0];
|
|
|
+
|
|
|
+ resolvedLanguages.push(baseLanguage);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return resolvedLanguages;
|
|
|
+ };
|
|
|
+
|
|
|
+ Defaults.prototype._processTranslations = function (languages, debug) {
|
|
|
+ var translations = new Translation();
|
|
|
+
|
|
|
+ for (var l = 0; l < languages.length; l++) {
|
|
|
+ var languageData = new Translation();
|
|
|
+
|
|
|
+ var language = languages[l];
|
|
|
+
|
|
|
+ if (typeof language === 'string') {
|
|
|
+ try {
|
|
|
+ // Try to load it with the original name
|
|
|
+ languageData = Translation.loadPath(language);
|
|
|
+ } catch (e) {
|
|
|
+ try {
|
|
|
+ // If we couldn't load it, check if it wasn't the full path
|
|
|
+ language = this.defaults.amdLanguageBase + language;
|
|
|
+ languageData = Translation.loadPath(language);
|
|
|
+ } catch (ex) {
|
|
|
+ // The translation could not be loaded at all. Sometimes this is
|
|
|
+ // because of a configuration problem, other times this can be
|
|
|
+ // because of how Select2 helps load all possible translation files
|
|
|
+ if (debug && window.console && console.warn) {
|
|
|
+ console.warn(
|
|
|
+ 'Select2: The language file for "' + language + '" could ' +
|
|
|
+ 'not be automatically loaded. A fallback will be used instead.'
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if ($.isPlainObject(language)) {
|
|
|
+ languageData = new Translation(language);
|
|
|
+ } else {
|
|
|
+ languageData = language;
|
|
|
+ }
|
|
|
+
|
|
|
+ translations.extend(languageData);
|
|
|
+ }
|
|
|
+
|
|
|
+ return translations;
|
|
|
+ };
|
|
|
+
|
|
|
Defaults.prototype.set = function (key, value) {
|
|
|
var camelKey = $.camelCase(key);
|
|
|
|
|
@@ -5045,6 +5179,10 @@ S2.define('select2/options',[
|
|
|
this.fromElement($element);
|
|
|
}
|
|
|
|
|
|
+ if ($element != null) {
|
|
|
+ this.options = Defaults.applyFromElement(this.options, $element);
|
|
|
+ }
|
|
|
+
|
|
|
this.options = Defaults.apply(this.options);
|
|
|
|
|
|
if ($element && $element.is('input')) {
|
|
@@ -5068,14 +5206,6 @@ S2.define('select2/options',[
|
|
|
this.options.disabled = $e.prop('disabled');
|
|
|
}
|
|
|
|
|
|
- if (this.options.language == null) {
|
|
|
- if ($e.prop('lang')) {
|
|
|
- this.options.language = $e.prop('lang').toLowerCase();
|
|
|
- } else if ($e.closest('[lang]').prop('lang')) {
|
|
|
- this.options.language = $e.closest('[lang]').prop('lang');
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
if (this.options.dir == null) {
|
|
|
if ($e.prop('dir')) {
|
|
|
this.options.dir = $e.prop('dir');
|