mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 22:28:51 +01:00
282830774d
* Fix Select2 widget for profile field "Country" * Placeholder for profile field "Country" * Placeholder for user field "Language" * Add select2-searchInputPlaceholder.js * Implement new form field Select2 * Use Select2 plugin for all drop-down list fields --------- Co-authored-by: Lucas Bartholemy <luke-@users.noreply.github.com>
23 lines
637 B
JavaScript
23 lines
637 B
JavaScript
(function($) {
|
|
|
|
var Defaults = $.fn.select2.amd.require('select2/defaults');
|
|
|
|
$.extend(Defaults.defaults, {
|
|
searchInputPlaceholder: ''
|
|
});
|
|
|
|
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'));
|
|
|
|
return $rendered;
|
|
};
|
|
|
|
})(window.jQuery); |