mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-15 10:48:36 +01:00
26 lines
744 B
JavaScript
26 lines
744 B
JavaScript
|
(function($) {
|
||
|
|
||
|
var Defaults = $.fn.select2.amd.require('select2/defaults');
|
||
|
|
||
|
$.extend(Defaults.defaults, {
|
||
|
searchInputPlaceholder: '',
|
||
|
searchInputCssClass: '',
|
||
|
});
|
||
|
|
||
|
var SearchDropdown = $.fn.select2.amd.require('select2/dropdown/search');
|
||
|
|
||
|
var _renderSearchDropdown = SearchDropdown.prototype.render;
|
||
|
|
||
|
SearchDropdown.prototype.render = function(decorated) {
|
||
|
|
||
|
// invoke parent method
|
||
|
var $rendered = _renderSearchDropdown.apply(this, Array.prototype.slice.apply(arguments));
|
||
|
|
||
|
this.$search.attr('placeholder', this.options.get('searchInputPlaceholder'));
|
||
|
this.$search.addClass(this.options.get('searchInputCssClass'));
|
||
|
|
||
|
return $rendered;
|
||
|
};
|
||
|
|
||
|
})(window.jQuery);
|