PHP Classes

File: vendors/gentelella/vendors/select2/src/js/select2/compat/initSelection.js

Recommend this page to a friend!
  Classes of Jorge Castro   Gentelella BladeOne   vendors/gentelella/vendors/select2/src/js/select2/compat/initSelection.js   Download  
File: vendors/gentelella/vendors/select2/src/js/select2/compat/initSelection.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Gentelella BladeOne
Render templates using Bootstrap for presentation
Author: By
Last change:
Date: 3 years ago
Size: 1,121 bytes
 

Contents

Class file image Download
define([ 'jquery' ], function ($) { function InitSelection (decorated, $element, options) { if (options.get('debug') && window.console && console.warn) { console.warn( 'Select2: The `initSelection` option has been deprecated in favor' + ' of a custom data adapter that overrides the `current` method. ' + 'This method is now called multiple times instead of a single ' + 'time when the instance is initialized. Support will be removed ' + 'for the `initSelection` option in future versions of Select2' ); } this.initSelection = options.get('initSelection'); this._isInitialized = false; decorated.call(this, $element, options); } InitSelection.prototype.current = function (decorated, callback) { var self = this; if (this._isInitialized) { decorated.call(this, callback); return; } this.initSelection.call(null, this.$element, function (data) { self._isInitialized = true; if (!$.isArray(data)) { data = [data]; } callback(data); }); }; return InitSelection; });