removed trailing spaces
This commit is contained in:
parent
ebcd59fb29
commit
45442aa8d7
37
select2.js
37
select2.js
@ -29,7 +29,7 @@
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|
||||||
(function ($, undefined) {
|
(function ($, undefined) {
|
||||||
@ -163,7 +163,7 @@
|
|||||||
*
|
*
|
||||||
* filters out mouse events that occur when mouse is stationary but
|
* filters out mouse events that occur when mouse is stationary but
|
||||||
* the elements under the pointer are scrolled.
|
* the elements under the pointer are scrolled.
|
||||||
*/
|
*/
|
||||||
function installFilteredMouseMove(element) {
|
function installFilteredMouseMove(element) {
|
||||||
element.bind("mousemove", function (e) {
|
element.bind("mousemove", function (e) {
|
||||||
var lastpos = $(document).data("select2-lastpos");
|
var lastpos = $(document).data("select2-lastpos");
|
||||||
@ -201,7 +201,7 @@
|
|||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
}
|
}
|
||||||
|
|
||||||
function measureTextWidth(e) {
|
function measureTextWidth(e) {
|
||||||
if (!sizer){
|
if (!sizer){
|
||||||
var style = e[0].currentStyle || window.getComputedStyle(e[0], null);
|
var style = e[0].currentStyle || window.getComputedStyle(e[0], null);
|
||||||
sizer = $("<div></div>").css({
|
sizer = $("<div></div>").css({
|
||||||
@ -216,10 +216,10 @@
|
|||||||
letterSpacing: style.letterSpacing,
|
letterSpacing: style.letterSpacing,
|
||||||
textTransform: style.textTransform,
|
textTransform: style.textTransform,
|
||||||
whiteSpace: "nowrap"
|
whiteSpace: "nowrap"
|
||||||
});
|
});
|
||||||
$("body").append(sizer);
|
$("body").append(sizer);
|
||||||
}
|
}
|
||||||
sizer.text(e.val());
|
sizer.text(e.val());
|
||||||
return sizer.width();
|
return sizer.width();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,11 +268,11 @@
|
|||||||
data = options.data, // ajax data function
|
data = options.data, // ajax data function
|
||||||
transport = options.transport || $.ajax,
|
transport = options.transport || $.ajax,
|
||||||
type = options.type || 'GET'; // set type of request (GET or POST)
|
type = options.type || 'GET'; // set type of request (GET or POST)
|
||||||
|
|
||||||
data = data.call(this, query.term, query.page, query.context);
|
data = data.call(this, query.term, query.page, query.context);
|
||||||
|
|
||||||
if( null !== handler) { handler.abort(); }
|
if( null !== handler) { handler.abort(); }
|
||||||
|
|
||||||
handler = transport.call(null, {
|
handler = transport.call(null, {
|
||||||
url: options.url,
|
url: options.url,
|
||||||
dataType: options.dataType,
|
dataType: options.dataType,
|
||||||
@ -507,14 +507,14 @@
|
|||||||
select2.opts.element
|
select2.opts.element
|
||||||
.removeData("select2")
|
.removeData("select2")
|
||||||
.unbind(".select2")
|
.unbind(".select2")
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// abstract
|
// abstract
|
||||||
prepareOpts: function (opts) {
|
prepareOpts: function (opts) {
|
||||||
var element, select, idKey;
|
var element, select, idKey;
|
||||||
|
|
||||||
element = opts.element;
|
element = opts.element;
|
||||||
|
|
||||||
if (element.get(0).tagName.toLowerCase() === "select") {
|
if (element.get(0).tagName.toLowerCase() === "select") {
|
||||||
@ -665,8 +665,7 @@
|
|||||||
data.push({id: this, text: this});
|
data.push({id: this, text: this});
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($.isFunction(callback))
|
callback(data);
|
||||||
callback(data);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -746,11 +745,11 @@
|
|||||||
if (this.opened()) return;
|
if (this.opened()) return;
|
||||||
|
|
||||||
this.container.addClass("select2-dropdown-open").addClass("select2-container-active");
|
this.container.addClass("select2-dropdown-open").addClass("select2-container-active");
|
||||||
if(this.dropdown[0] !== this.body.children().last()[0]) {
|
if(this.dropdown[0] !== this.body.children().last()[0]) {
|
||||||
// ensure the dropdown is the last child of body, so the z-index is always respected correctly
|
// ensure the dropdown is the last child of body, so the z-index is always respected correctly
|
||||||
this.dropdown.detach().appendTo(this.body);
|
this.dropdown.detach().appendTo(this.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dropdown.addClass("select2-drop-active");
|
this.dropdown.addClass("select2-drop-active");
|
||||||
|
|
||||||
this.positionDropdown();
|
this.positionDropdown();
|
||||||
@ -779,11 +778,11 @@
|
|||||||
// abstract
|
// abstract
|
||||||
ensureHighlightVisible: function () {
|
ensureHighlightVisible: function () {
|
||||||
var results = this.results, children, index, child, hb, rb, y, more;
|
var results = this.results, children, index, child, hb, rb, y, more;
|
||||||
|
|
||||||
index = this.highlight();
|
index = this.highlight();
|
||||||
|
|
||||||
if (index < 0) return;
|
if (index < 0) return;
|
||||||
|
|
||||||
children = results.find(".select2-result");
|
children = results.find(".select2-result");
|
||||||
|
|
||||||
child = $(children[index]);
|
child = $(children[index]);
|
||||||
@ -849,7 +848,7 @@
|
|||||||
|
|
||||||
// abstract
|
// abstract
|
||||||
highlightUnderEvent: function (event) {
|
highlightUnderEvent: function (event) {
|
||||||
var el = $(event.target).closest(".select2-result");
|
var el = $(event.target).closest(".select2-result");
|
||||||
if (el.length > 0 && !el.is(".select2-highlighted")) {
|
if (el.length > 0 && !el.is(".select2-highlighted")) {
|
||||||
var choices = this.results.find('.select2-result');
|
var choices = this.results.find('.select2-result');
|
||||||
this.highlight(choices.index(el));
|
this.highlight(choices.index(el));
|
||||||
@ -1185,7 +1184,7 @@
|
|||||||
self.updateSelection(selected);
|
self.updateSelection(selected);
|
||||||
self.close();
|
self.close();
|
||||||
self.setPlaceholder();
|
self.setPlaceholder();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1481,9 +1480,9 @@
|
|||||||
self.close();
|
self.close();
|
||||||
// set the placeholder if necessary
|
// set the placeholder if necessary
|
||||||
self.clearSearch();
|
self.clearSearch();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user