Skip to content

Commit

Permalink
Recompile dist with master
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-brown committed Apr 24, 2016
1 parent 5b5eddd commit f3b91d0
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 10 deletions.
2 changes: 2 additions & 0 deletions dist/css/select2.css
Expand Up @@ -184,6 +184,8 @@
margin: 0;
padding: 0 5px;
width: 100%; }
.select2-container--default .select2-selection--multiple .select2-selection__rendered li {
list-style: none; }
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
color: #999;
margin-top: 5px;
Expand Down
3 changes: 3 additions & 0 deletions dist/js/i18n/km.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/js/i18n/lt.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/js/i18n/nb.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 49 additions & 4 deletions dist/js/select2.full.js
Expand Up @@ -1497,6 +1497,12 @@ S2.define('select2/selection/single',[
// User exits the container
});

container.on('focus', function (evt) {
if (!container.isOpen()) {
self.$selection.focus();
}
});

container.on('selection:update', function (params) {
self.update(params.data);
});
Expand Down Expand Up @@ -3436,6 +3442,12 @@ S2.define('select2/data/ajax',[

callback(results);
}, function () {
// Attempt to detect if a request was aborted
// Only works if the transport exposes a status property
if ($request.status && $request.status === '0') {
return;
}

self.trigger('results:message', {
message: 'errorLoading'
});
Expand Down Expand Up @@ -3607,6 +3619,29 @@ S2.define('select2/data/tokenizer',[
Tokenizer.prototype.query = function (decorated, params, callback) {
var self = this;

function createAndSelect (data) {
// Normalize the data object so we can use it for checks
var item = self._normalizeItem(data);

// Check if the data object already exists as a tag
// Select it if it doesn't
var $existingOptions = self.$element.find('option').filter(function () {
return $(this).val() === item.id;
});

// If an existing option wasn't found for it, create the option
if (!$existingOptions.length) {
var $option = self.option(item);
$option.attr('data-select2-tag', true);

self._removeOldTags();
self.addOptions([$option]);
}

// Select the item, now that we know there is an option for it
select(item);
}

function select (data) {
self.trigger('select', {
data: data
Expand All @@ -3615,7 +3650,7 @@ S2.define('select2/data/tokenizer',[

params.term = params.term || '';

var tokenData = this.tokenizer(params, this.options, select);
var tokenData = this.tokenizer(params, this.options, createAndSelect);

if (tokenData.term !== params.term) {
// Replace the search term if we have the search box
Expand Down Expand Up @@ -3880,6 +3915,12 @@ S2.define('select2/dropdown/search',[
self.$search.val('');
});

container.on('focus', function () {
if (container.isOpen()) {
self.$search.focus();
}
});

container.on('results:all', function (params) {
if (params.query.term == null || params.query.term === '') {
var showSearch = self.showSearch(params);
Expand Down Expand Up @@ -4229,7 +4270,7 @@ S2.define('select2/dropdown/attachBody',[

if (newDirection == 'above' ||
(isCurrentlyAbove && newDirection !== 'below')) {
css.top = container.top - dropdown.height;
css.top = container.top - parentOffset.top - dropdown.height;
}

if (newDirection != null) {
Expand All @@ -4251,6 +4292,7 @@ S2.define('select2/dropdown/attachBody',[

if (this.options.get('dropdownAutoWidth')) {
css.minWidth = css.width;
css.position = 'relative';
css.width = 'auto';
}

Expand Down Expand Up @@ -5129,6 +5171,10 @@ S2.define('select2/core',[
});
});

this.$element.on('focus.select2', function (evt) {
self.trigger('focus', evt);
});

this._sync = Utils.bind(this._syncAttributes, this);

if (this.$element[0].attachEvent) {
Expand Down Expand Up @@ -6235,6 +6281,7 @@ S2.define('jquery.select2',[
return this;
} else if (typeof options === 'string') {
var ret;
var args = Array.prototype.slice.call(arguments, 1);

this.each(function () {
var instance = $(this).data('select2');
Expand All @@ -6246,8 +6293,6 @@ S2.define('jquery.select2',[
);
}

var args = Array.prototype.slice.call(arguments, 1);

ret = instance[options].apply(instance, args);
});

Expand Down
53 changes: 49 additions & 4 deletions dist/js/select2.js
Expand Up @@ -1497,6 +1497,12 @@ S2.define('select2/selection/single',[
// User exits the container
});

container.on('focus', function (evt) {
if (!container.isOpen()) {
self.$selection.focus();
}
});

container.on('selection:update', function (params) {
self.update(params.data);
});
Expand Down Expand Up @@ -3436,6 +3442,12 @@ S2.define('select2/data/ajax',[

callback(results);
}, function () {
// Attempt to detect if a request was aborted
// Only works if the transport exposes a status property
if ($request.status && $request.status === '0') {
return;
}

self.trigger('results:message', {
message: 'errorLoading'
});
Expand Down Expand Up @@ -3607,6 +3619,29 @@ S2.define('select2/data/tokenizer',[
Tokenizer.prototype.query = function (decorated, params, callback) {
var self = this;

function createAndSelect (data) {
// Normalize the data object so we can use it for checks
var item = self._normalizeItem(data);

// Check if the data object already exists as a tag
// Select it if it doesn't
var $existingOptions = self.$element.find('option').filter(function () {
return $(this).val() === item.id;
});

// If an existing option wasn't found for it, create the option
if (!$existingOptions.length) {
var $option = self.option(item);
$option.attr('data-select2-tag', true);

self._removeOldTags();
self.addOptions([$option]);
}

// Select the item, now that we know there is an option for it
select(item);
}

function select (data) {
self.trigger('select', {
data: data
Expand All @@ -3615,7 +3650,7 @@ S2.define('select2/data/tokenizer',[

params.term = params.term || '';

var tokenData = this.tokenizer(params, this.options, select);
var tokenData = this.tokenizer(params, this.options, createAndSelect);

if (tokenData.term !== params.term) {
// Replace the search term if we have the search box
Expand Down Expand Up @@ -3880,6 +3915,12 @@ S2.define('select2/dropdown/search',[
self.$search.val('');
});

container.on('focus', function () {
if (container.isOpen()) {
self.$search.focus();
}
});

container.on('results:all', function (params) {
if (params.query.term == null || params.query.term === '') {
var showSearch = self.showSearch(params);
Expand Down Expand Up @@ -4229,7 +4270,7 @@ S2.define('select2/dropdown/attachBody',[

if (newDirection == 'above' ||
(isCurrentlyAbove && newDirection !== 'below')) {
css.top = container.top - dropdown.height;
css.top = container.top - parentOffset.top - dropdown.height;
}

if (newDirection != null) {
Expand All @@ -4251,6 +4292,7 @@ S2.define('select2/dropdown/attachBody',[

if (this.options.get('dropdownAutoWidth')) {
css.minWidth = css.width;
css.position = 'relative';
css.width = 'auto';
}

Expand Down Expand Up @@ -5129,6 +5171,10 @@ S2.define('select2/core',[
});
});

this.$element.on('focus.select2', function (evt) {
self.trigger('focus', evt);
});

this._sync = Utils.bind(this._syncAttributes, this);

if (this.$element[0].attachEvent) {
Expand Down Expand Up @@ -5524,6 +5570,7 @@ S2.define('jquery.select2',[
return this;
} else if (typeof options === 'string') {
var ret;
var args = Array.prototype.slice.call(arguments, 1);

this.each(function () {
var instance = $(this).data('select2');
Expand All @@ -5535,8 +5582,6 @@ S2.define('jquery.select2',[
);
}

var args = Array.prototype.slice.call(arguments, 1);

ret = instance[options].apply(instance, args);
});

Expand Down

0 comments on commit f3b91d0

Please sign in to comment.