1
0
mirror of synced 2024-11-26 06:46:04 +03:00

Recompile dist

This commit is contained in:
Kevin Brown 2015-08-21 19:19:06 -04:00
parent a86c2e709f
commit b69dd827d0
4 changed files with 49 additions and 35 deletions

View File

@ -1041,7 +1041,7 @@ S2.define('select2/results',[
var data = $highlighted.data('data'); var data = $highlighted.data('data');
if ($highlighted.attr('aria-selected') == 'true') { if ($highlighted.attr('aria-selected') == 'true') {
self.trigger('close'); self.trigger('close', {});
} else { } else {
self.trigger('select', { self.trigger('select', {
data: data data: data
@ -1163,7 +1163,7 @@ S2.define('select2/results',[
data: data data: data
}); });
} else { } else {
self.trigger('close'); self.trigger('close', {});
} }
return; return;
@ -1746,7 +1746,7 @@ S2.define('select2/selection/allowClear',[
this.$element.val(this.placeholder.id).trigger('change'); this.$element.val(this.placeholder.id).trigger('change');
this.trigger('toggle'); this.trigger('toggle', {});
}; };
AllowClear.prototype._handleKeyboardClear = function (_, evt, container) { AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
@ -1966,7 +1966,7 @@ S2.define('select2/selection/search',[
data: item data: item
}); });
this.trigger('open'); this.trigger('open', {});
this.$search.val(item.text + ' '); this.$search.val(item.text + ' ');
}; };
@ -3574,7 +3574,9 @@ S2.define('select2/data/tokenizer',[
var self = this; var self = this;
function select (data) { function select (data) {
self.select(data); self.trigger('select', {
data: data
});
} }
params.term = params.term || ''; params.term = params.term || '';
@ -3622,6 +3624,11 @@ S2.define('select2/data/tokenizer',[
var data = createTag(partParams); var data = createTag(partParams);
if (data == null) {
i++;
continue;
}
callback(data); callback(data);
// Reset the term to not include the tokenized portion // Reset the term to not include the tokenized portion
@ -4302,7 +4309,7 @@ S2.define('select2/dropdown/closeOnSelect',[
return; return;
} }
this.trigger('close'); this.trigger('close', {});
}; };
return CloseOnSelect; return CloseOnSelect;
@ -5149,7 +5156,7 @@ S2.define('select2/core',[
this.on('query', function (params) { this.on('query', function (params) {
if (!self.isOpen()) { if (!self.isOpen()) {
self.trigger('open'); self.trigger('open', {});
} }
this.dataAdapter.query(params, function (data) { this.dataAdapter.query(params, function (data) {
@ -5179,19 +5186,19 @@ S2.define('select2/core',[
evt.preventDefault(); evt.preventDefault();
} else if (key === KEYS.ENTER) { } else if (key === KEYS.ENTER) {
self.trigger('results:select'); self.trigger('results:select', {});
evt.preventDefault(); evt.preventDefault();
} else if ((key === KEYS.SPACE && evt.ctrlKey)) { } else if ((key === KEYS.SPACE && evt.ctrlKey)) {
self.trigger('results:toggle'); self.trigger('results:toggle', {});
evt.preventDefault(); evt.preventDefault();
} else if (key === KEYS.UP) { } else if (key === KEYS.UP) {
self.trigger('results:previous'); self.trigger('results:previous', {});
evt.preventDefault(); evt.preventDefault();
} else if (key === KEYS.DOWN) { } else if (key === KEYS.DOWN) {
self.trigger('results:next'); self.trigger('results:next', {});
evt.preventDefault(); evt.preventDefault();
} }
@ -5214,9 +5221,9 @@ S2.define('select2/core',[
this.close(); this.close();
} }
this.trigger('disable'); this.trigger('disable', {});
} else { } else {
this.trigger('enable'); this.trigger('enable', {});
} }
}; };
@ -5278,7 +5285,7 @@ S2.define('select2/core',[
return; return;
} }
this.trigger('close'); this.trigger('close', {});
}; };
Select2.prototype.isOpen = function () { Select2.prototype.isOpen = function () {
@ -5296,7 +5303,7 @@ S2.define('select2/core',[
} }
this.$container.addClass('select2-container--focus'); this.$container.addClass('select2-container--focus');
this.trigger('focus'); this.trigger('focus', {});
}; };
Select2.prototype.enable = function (args) { Select2.prototype.enable = function (args) {

File diff suppressed because one or more lines are too long

37
dist/js/select2.js vendored
View File

@ -1041,7 +1041,7 @@ S2.define('select2/results',[
var data = $highlighted.data('data'); var data = $highlighted.data('data');
if ($highlighted.attr('aria-selected') == 'true') { if ($highlighted.attr('aria-selected') == 'true') {
self.trigger('close'); self.trigger('close', {});
} else { } else {
self.trigger('select', { self.trigger('select', {
data: data data: data
@ -1163,7 +1163,7 @@ S2.define('select2/results',[
data: data data: data
}); });
} else { } else {
self.trigger('close'); self.trigger('close', {});
} }
return; return;
@ -1746,7 +1746,7 @@ S2.define('select2/selection/allowClear',[
this.$element.val(this.placeholder.id).trigger('change'); this.$element.val(this.placeholder.id).trigger('change');
this.trigger('toggle'); this.trigger('toggle', {});
}; };
AllowClear.prototype._handleKeyboardClear = function (_, evt, container) { AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
@ -1966,7 +1966,7 @@ S2.define('select2/selection/search',[
data: item data: item
}); });
this.trigger('open'); this.trigger('open', {});
this.$search.val(item.text + ' '); this.$search.val(item.text + ' ');
}; };
@ -3574,7 +3574,9 @@ S2.define('select2/data/tokenizer',[
var self = this; var self = this;
function select (data) { function select (data) {
self.select(data); self.trigger('select', {
data: data
});
} }
params.term = params.term || ''; params.term = params.term || '';
@ -3622,6 +3624,11 @@ S2.define('select2/data/tokenizer',[
var data = createTag(partParams); var data = createTag(partParams);
if (data == null) {
i++;
continue;
}
callback(data); callback(data);
// Reset the term to not include the tokenized portion // Reset the term to not include the tokenized portion
@ -4302,7 +4309,7 @@ S2.define('select2/dropdown/closeOnSelect',[
return; return;
} }
this.trigger('close'); this.trigger('close', {});
}; };
return CloseOnSelect; return CloseOnSelect;
@ -5149,7 +5156,7 @@ S2.define('select2/core',[
this.on('query', function (params) { this.on('query', function (params) {
if (!self.isOpen()) { if (!self.isOpen()) {
self.trigger('open'); self.trigger('open', {});
} }
this.dataAdapter.query(params, function (data) { this.dataAdapter.query(params, function (data) {
@ -5179,19 +5186,19 @@ S2.define('select2/core',[
evt.preventDefault(); evt.preventDefault();
} else if (key === KEYS.ENTER) { } else if (key === KEYS.ENTER) {
self.trigger('results:select'); self.trigger('results:select', {});
evt.preventDefault(); evt.preventDefault();
} else if ((key === KEYS.SPACE && evt.ctrlKey)) { } else if ((key === KEYS.SPACE && evt.ctrlKey)) {
self.trigger('results:toggle'); self.trigger('results:toggle', {});
evt.preventDefault(); evt.preventDefault();
} else if (key === KEYS.UP) { } else if (key === KEYS.UP) {
self.trigger('results:previous'); self.trigger('results:previous', {});
evt.preventDefault(); evt.preventDefault();
} else if (key === KEYS.DOWN) { } else if (key === KEYS.DOWN) {
self.trigger('results:next'); self.trigger('results:next', {});
evt.preventDefault(); evt.preventDefault();
} }
@ -5214,9 +5221,9 @@ S2.define('select2/core',[
this.close(); this.close();
} }
this.trigger('disable'); this.trigger('disable', {});
} else { } else {
this.trigger('enable'); this.trigger('enable', {});
} }
}; };
@ -5278,7 +5285,7 @@ S2.define('select2/core',[
return; return;
} }
this.trigger('close'); this.trigger('close', {});
}; };
Select2.prototype.isOpen = function () { Select2.prototype.isOpen = function () {
@ -5296,7 +5303,7 @@ S2.define('select2/core',[
} }
this.$container.addClass('select2-container--focus'); this.$container.addClass('select2-container--focus');
this.trigger('focus'); this.trigger('focus', {});
}; };
Select2.prototype.enable = function (args) { Select2.prototype.enable = function (args) {

File diff suppressed because one or more lines are too long