select2
Version:
Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.
30 lines (21 loc) • 605 B
JavaScript
define([
], function () {
function SelectOnClose () { }
SelectOnClose.prototype.bind = function (decorated, container, $container) {
var self = this;
decorated.call(this, container, $container);
container.on('close', function () {
self._handleSelectOnClose();
});
};
SelectOnClose.prototype._handleSelectOnClose = function () {
var $highlightedResults = this.getHighlightedResults();
if ($highlightedResults.length < 1) {
return;
}
this.trigger('select', {
data: $highlightedResults.data('data')
});
};
return SelectOnClose;
});