Skip to content

Commit

Permalink
Recompile dist
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-brown committed Jan 15, 2016
1 parent 0840c39 commit 97f7eea
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 20 deletions.
2 changes: 1 addition & 1 deletion dist/css/select2.min.css

Large diffs are not rendered by default.

29 changes: 21 additions & 8 deletions dist/js/select2.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -3332,7 +3332,7 @@ S2.define('select2/data/array',[
var $existingOption = $existing.filter(onlyItem(item));

var existingData = this.item($existingOption);
var newData = $.extend(true, {}, existingData, item);
var newData = $.extend(true, {}, item, existingData);

var $newOption = this.option(newData);

Expand Down Expand Up @@ -3440,7 +3440,9 @@ S2.define('select2/data/ajax',[

callback(results);
}, function () {
// TODO: Handle AJAX errors
self.trigger('results:message', {
message: 'errorLoading'
});
});

self._request = $request;
Expand Down Expand Up @@ -3472,6 +3474,12 @@ S2.define('select2/data/tags',[
this.createTag = createTag;
}

var insertTag = options.get('insertTag');

if (insertTag !== undefined) {
this.insertTag = insertTag;
}

decorated.call(this, $element, options);

if ($.isArray(tags)) {
Expand Down Expand Up @@ -4171,7 +4179,6 @@ S2.define('select2/dropdown/attachBody',[

var newDirection = null;

var position = this.$container.position();
var offset = this.$container.offset();

offset.bottom = offset.top + this.$container.outerHeight(false);
Expand Down Expand Up @@ -4200,14 +4207,20 @@ S2.define('select2/dropdown/attachBody',[
top: container.bottom
};

// Fix positioning with static parents
if (this.$dropdownParent[0].style.position !== 'static') {
var parentOffset = this.$dropdownParent.offset();
// Determine what the parent element is to use for calciulating the offset
var $offsetParent = this.$dropdownParent;

css.top -= parentOffset.top;
css.left -= parentOffset.left;
// For statically positoned elements, we need to get the element
// that is determining the offset
if ($offsetParent.css('position') === 'static') {
$offsetParent = $offsetParent.offsetParent();
}

var parentOffset = $offsetParent.offset();

css.top -= parentOffset.top;
css.left -= parentOffset.left;

if (!isCurrentlyAbove && !isCurrentlyBelow) {
newDirection = 'below';
}
Expand Down
4 changes: 2 additions & 2 deletions dist/js/select2.full.min.js

Large diffs are not rendered by default.

29 changes: 21 additions & 8 deletions dist/js/select2.js
Original file line number Diff line number Diff line change
Expand Up @@ -3332,7 +3332,7 @@ S2.define('select2/data/array',[
var $existingOption = $existing.filter(onlyItem(item));

var existingData = this.item($existingOption);
var newData = $.extend(true, {}, existingData, item);
var newData = $.extend(true, {}, item, existingData);

var $newOption = this.option(newData);

Expand Down Expand Up @@ -3440,7 +3440,9 @@ S2.define('select2/data/ajax',[

callback(results);
}, function () {
// TODO: Handle AJAX errors
self.trigger('results:message', {
message: 'errorLoading'
});
});

self._request = $request;
Expand Down Expand Up @@ -3472,6 +3474,12 @@ S2.define('select2/data/tags',[
this.createTag = createTag;
}

var insertTag = options.get('insertTag');

if (insertTag !== undefined) {
this.insertTag = insertTag;
}

decorated.call(this, $element, options);

if ($.isArray(tags)) {
Expand Down Expand Up @@ -4171,7 +4179,6 @@ S2.define('select2/dropdown/attachBody',[

var newDirection = null;

var position = this.$container.position();
var offset = this.$container.offset();

offset.bottom = offset.top + this.$container.outerHeight(false);
Expand Down Expand Up @@ -4200,14 +4207,20 @@ S2.define('select2/dropdown/attachBody',[
top: container.bottom
};

// Fix positioning with static parents
if (this.$dropdownParent[0].style.position !== 'static') {
var parentOffset = this.$dropdownParent.offset();
// Determine what the parent element is to use for calciulating the offset
var $offsetParent = this.$dropdownParent;

css.top -= parentOffset.top;
css.left -= parentOffset.left;
// For statically positoned elements, we need to get the element
// that is determining the offset
if ($offsetParent.css('position') === 'static') {
$offsetParent = $offsetParent.offsetParent();
}

var parentOffset = $offsetParent.offset();

css.top -= parentOffset.top;
css.left -= parentOffset.left;

if (!isCurrentlyAbove && !isCurrentlyBelow) {
newDirection = 'below';
}
Expand Down
2 changes: 1 addition & 1 deletion dist/js/select2.min.js

Large diffs are not rendered by default.

0 comments on commit 97f7eea

Please sign in to comment.