PHP Classes

File: public/asset/vendor/select2/src/js/select2/dropdown/closeOnSelect.js

Recommend this page to a friend!
  Classes of fathurrahman   mnTemplate   public/asset/vendor/select2/src/js/select2/dropdown/closeOnSelect.js   Download  
File: public/asset/vendor/select2/src/js/select2/dropdown/closeOnSelect.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: mnTemplate
Route HTTP requests to callback functions
Author: By
Last change:
Date: 1 year ago
Size: 789 bytes
 

Contents

Class file image Download
define([ ], function () { function CloseOnSelect () { } CloseOnSelect.prototype.bind = function (decorated, container, $container) { var self = this; decorated.call(this, container, $container); container.on('select', function (evt) { self._selectTriggered(evt); }); container.on('unselect', function (evt) { self._selectTriggered(evt); }); }; CloseOnSelect.prototype._selectTriggered = function (_, evt) { var originalEvent = evt.originalEvent; // Don't close if the control key is being held if (originalEvent && (originalEvent.ctrlKey || originalEvent.metaKey)) { return; } this.trigger('close', { originalEvent: originalEvent, originalSelect2Event: evt }); }; return CloseOnSelect; });