PHP Classes

File: vendors/gentelella/vendors/select2/src/js/select2/data/maximumSelectionLength.js

Recommend this page to a friend!
  Classes of Jorge Castro   Gentelella BladeOne   vendors/gentelella/vendors/select2/src/js/select2/data/maximumSelectionLength.js   Download  
File: vendors/gentelella/vendors/select2/src/js/select2/data/maximumSelectionLength.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: 836 bytes
 

Contents

Class file image Download
define([ ], function (){ function MaximumSelectionLength (decorated, $e, options) { this.maximumSelectionLength = options.get('maximumSelectionLength'); decorated.call(this, $e, options); } MaximumSelectionLength.prototype.query = function (decorated, params, callback) { var self = this; this.current(function (currentData) { var count = currentData != null ? currentData.length : 0; if (self.maximumSelectionLength > 0 && count >= self.maximumSelectionLength) { self.trigger('results:message', { message: 'maximumSelected', args: { maximum: self.maximumSelectionLength } }); return; } decorated.call(self, params, callback); }); }; return MaximumSelectionLength; });