select2-rails 3.3.1 → 3.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/assets/javascripts/select2.js +137 -62
- data/app/assets/stylesheets/select2.css.scss +16 -3
- data/lib/select2-rails/version.rb +1 -1
- metadata +2 -2
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
Copyright 2012 Igor Vaynberg
|
3
3
|
|
4
|
-
Version: 3.3.
|
4
|
+
Version: 3.3.2 Timestamp: Mon Mar 25 12:14:18 PDT 2013
|
5
5
|
|
6
6
|
This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
|
7
7
|
General Public License version 2 (the "GPL License"). You may choose either license to govern your
|
@@ -118,8 +118,8 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
118
118
|
if (a === b) return true;
|
119
119
|
if (a === undefined || b === undefined) return false;
|
120
120
|
if (a === null || b === null) return false;
|
121
|
-
if (a.constructor === String) return a === b+'';
|
122
|
-
if (b.constructor === String) return b === a+'';
|
121
|
+
if (a.constructor === String) return a+'' === b+''; // IE requires a+'' instead of just a
|
122
|
+
if (b.constructor === String) return b+'' === a+''; // IE requires b+'' instead of just b
|
123
123
|
return false;
|
124
124
|
}
|
125
125
|
|
@@ -229,20 +229,22 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
229
229
|
|
230
230
|
$el.focus();
|
231
231
|
|
232
|
-
/*
|
233
|
-
|
234
|
-
if(el.
|
235
|
-
{
|
236
|
-
el.setSelectionRange(pos, pos);
|
237
|
-
}
|
238
|
-
else if (el.createTextRange) {
|
239
|
-
range = el.createTextRange();
|
240
|
-
range.collapse(true);
|
241
|
-
range.moveEnd('character', pos);
|
242
|
-
range.moveStart('character', pos);
|
243
|
-
range.select();
|
244
|
-
}
|
232
|
+
/* make sure el received focus so we do not error out when trying to manipulate the caret.
|
233
|
+
sometimes modals or others listeners may steal it after its set */
|
234
|
+
if ($el.is(":visible") && el === document.activeElement) {
|
245
235
|
|
236
|
+
/* after the focus is set move the caret to the end, necessary when we val()
|
237
|
+
just before setting focus */
|
238
|
+
if(el.setSelectionRange)
|
239
|
+
{
|
240
|
+
el.setSelectionRange(pos, pos);
|
241
|
+
}
|
242
|
+
else if (el.createTextRange) {
|
243
|
+
range = el.createTextRange();
|
244
|
+
range.collapse(false);
|
245
|
+
range.select();
|
246
|
+
}
|
247
|
+
}
|
246
248
|
}, 0);
|
247
249
|
}
|
248
250
|
|
@@ -282,7 +284,8 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
282
284
|
var classes, replacements = [], adapted;
|
283
285
|
|
284
286
|
classes = dest.attr("class");
|
285
|
-
if (
|
287
|
+
if (classes) {
|
288
|
+
classes = '' + classes; // for IE which returns object
|
286
289
|
$(classes.split(" ")).each2(function() {
|
287
290
|
if (this.indexOf("select2-") === 0) {
|
288
291
|
replacements.push(this);
|
@@ -290,11 +293,12 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
290
293
|
});
|
291
294
|
}
|
292
295
|
classes = src.attr("class");
|
293
|
-
if (
|
296
|
+
if (classes) {
|
297
|
+
classes = '' + classes; // for IE which returns object
|
294
298
|
$(classes.split(" ")).each2(function() {
|
295
299
|
if (this.indexOf("select2-") !== 0) {
|
296
300
|
adapted = adapter(this);
|
297
|
-
if (
|
301
|
+
if (adapted) {
|
298
302
|
replacements.push(this);
|
299
303
|
}
|
300
304
|
}
|
@@ -790,7 +794,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
790
794
|
if ("tags" in opts) {
|
791
795
|
throw "tags specified as both an attribute 'data-select2-tags' and in options of Select2 " + opts.element.attr("id");
|
792
796
|
}
|
793
|
-
opts.tags=opts.element.
|
797
|
+
opts.tags=opts.element.data("select2Tags");
|
794
798
|
}
|
795
799
|
|
796
800
|
if (select) {
|
@@ -1119,9 +1123,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
1119
1123
|
this.dropdown.attr("id", "select2-drop");
|
1120
1124
|
|
1121
1125
|
// show the elements
|
1122
|
-
mask.css(
|
1123
|
-
width: document.documentElement.scrollWidth,
|
1124
|
-
height: document.documentElement.scrollHeight});
|
1126
|
+
mask.css(_makeMaskCss());
|
1125
1127
|
mask.show();
|
1126
1128
|
this.dropdown.show();
|
1127
1129
|
this.positionDropdown();
|
@@ -1134,14 +1136,19 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
1134
1136
|
var that = this;
|
1135
1137
|
this.container.parents().add(window).each(function () {
|
1136
1138
|
$(this).bind(resize+" "+scroll+" "+orient, function (e) {
|
1137
|
-
$("#select2-drop-mask").css(
|
1138
|
-
width:document.documentElement.scrollWidth,
|
1139
|
-
height:document.documentElement.scrollHeight});
|
1139
|
+
$("#select2-drop-mask").css(_makeMaskCss());
|
1140
1140
|
that.positionDropdown();
|
1141
1141
|
});
|
1142
1142
|
});
|
1143
1143
|
|
1144
1144
|
this.focusSearch();
|
1145
|
+
|
1146
|
+
function _makeMaskCss() {
|
1147
|
+
return {
|
1148
|
+
width : Math.max(document.documentElement.scrollWidth, $(window).width()),
|
1149
|
+
height : Math.max(document.documentElement.scrollHeight, $(window).height())
|
1150
|
+
}
|
1151
|
+
}
|
1145
1152
|
},
|
1146
1153
|
|
1147
1154
|
// abstract
|
@@ -1164,7 +1171,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
1164
1171
|
this.container.removeClass("select2-dropdown-open");
|
1165
1172
|
this.results.empty();
|
1166
1173
|
this.clearSearch();
|
1167
|
-
|
1174
|
+
this.search.removeClass("select2-active");
|
1168
1175
|
this.opts.element.trigger($.Event("close"));
|
1169
1176
|
},
|
1170
1177
|
|
@@ -1315,6 +1322,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
1315
1322
|
|
1316
1323
|
|
1317
1324
|
self.opts.populateResults.call(this, results, data.results, {term: term, page: page, context:context});
|
1325
|
+
self.postprocessResults(data, false, false);
|
1318
1326
|
|
1319
1327
|
if (data.more===true) {
|
1320
1328
|
more.detach().appendTo(results).text(self.opts.formatLoadMore(page+1));
|
@@ -1341,15 +1349,25 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
1341
1349
|
*/
|
1342
1350
|
// abstract
|
1343
1351
|
updateResults: function (initial) {
|
1344
|
-
var search = this.search,
|
1352
|
+
var search = this.search,
|
1353
|
+
results = this.results,
|
1354
|
+
opts = this.opts,
|
1355
|
+
data,
|
1356
|
+
self = this,
|
1357
|
+
input,
|
1358
|
+
term = search.val(),
|
1359
|
+
lastTerm=$.data(this.container, "select2-last-term");
|
1360
|
+
|
1361
|
+
// prevent duplicate queries against the same term
|
1362
|
+
if (initial !== true && lastTerm && equal(term, lastTerm)) return;
|
1363
|
+
|
1364
|
+
$.data(this.container, "select2-last-term", term);
|
1345
1365
|
|
1346
1366
|
// if the search is currently hidden we do not alter the results
|
1347
1367
|
if (initial !== true && (this.showSearchInput === false || !this.opened())) {
|
1348
1368
|
return;
|
1349
1369
|
}
|
1350
1370
|
|
1351
|
-
search.addClass("select2-active");
|
1352
|
-
|
1353
1371
|
function postRender() {
|
1354
1372
|
results.scrollTop(0);
|
1355
1373
|
search.removeClass("select2-active");
|
@@ -1378,9 +1396,6 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
1378
1396
|
}
|
1379
1397
|
return;
|
1380
1398
|
}
|
1381
|
-
else if (opts.formatSearching() && initial===true) {
|
1382
|
-
render("<li class='select2-searching'>" + opts.formatSearching() + "</li>");
|
1383
|
-
}
|
1384
1399
|
|
1385
1400
|
if (opts.maximumInputLength && search.val().length > opts.maximumInputLength) {
|
1386
1401
|
if (checkFormatter(opts.formatInputTooLong, "formatInputTooLong")) {
|
@@ -1391,6 +1406,12 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
1391
1406
|
return;
|
1392
1407
|
}
|
1393
1408
|
|
1409
|
+
if (opts.formatSearching && this.findHighlightableChoices().length === 0) {
|
1410
|
+
render("<li class='select2-searching'>" + opts.formatSearching() + "</li>");
|
1411
|
+
}
|
1412
|
+
|
1413
|
+
search.addClass("select2-active");
|
1414
|
+
|
1394
1415
|
// give the tokenizer a chance to pre-process the input
|
1395
1416
|
input = this.tokenize();
|
1396
1417
|
if (input != undefined && input != null) {
|
@@ -1409,7 +1430,10 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
1409
1430
|
var def; // default choice
|
1410
1431
|
|
1411
1432
|
// ignore a response if the select2 has been closed before it was received
|
1412
|
-
if (!this.opened())
|
1433
|
+
if (!this.opened()) {
|
1434
|
+
this.search.removeClass("select2-active");
|
1435
|
+
return;
|
1436
|
+
}
|
1413
1437
|
|
1414
1438
|
// save context, if any
|
1415
1439
|
this.context = (data.context===undefined) ? null : data.context;
|
@@ -1442,6 +1466,8 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
1442
1466
|
this.postprocessResults(data, initial);
|
1443
1467
|
|
1444
1468
|
postRender();
|
1469
|
+
|
1470
|
+
this.opts.element.trigger({ type: "loaded", data:data });
|
1445
1471
|
})});
|
1446
1472
|
},
|
1447
1473
|
|
@@ -1635,6 +1661,11 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
1635
1661
|
|
1636
1662
|
this.focusser = container.find(".select2-focusser");
|
1637
1663
|
|
1664
|
+
// rewrite labels from original element to focusser
|
1665
|
+
this.focusser.attr("id", "s2id_autogen"+nextUid());
|
1666
|
+
$("label[for='" + this.opts.element.attr("id") + "']")
|
1667
|
+
.attr('for', this.focusser.attr('id'));
|
1668
|
+
|
1638
1669
|
this.search.bind("keydown", this.bind(function (e) {
|
1639
1670
|
if (!this.enabled) return;
|
1640
1671
|
|
@@ -1662,6 +1693,16 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
1662
1693
|
}
|
1663
1694
|
}));
|
1664
1695
|
|
1696
|
+
this.search.bind("blur", this.bind(function(e) {
|
1697
|
+
// a workaround for chrome to keep the search field focussed when the scroll bar is used to scroll the dropdown.
|
1698
|
+
// without this the search field loses focus which is annoying
|
1699
|
+
if (document.activeElement === this.body().get(0)) {
|
1700
|
+
window.setTimeout(this.bind(function() {
|
1701
|
+
this.search.focus();
|
1702
|
+
}), 0);
|
1703
|
+
}
|
1704
|
+
}));
|
1705
|
+
|
1665
1706
|
this.focusser.bind("keydown", this.bind(function (e) {
|
1666
1707
|
if (!this.enabled) return;
|
1667
1708
|
|
@@ -1747,15 +1788,19 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
1747
1788
|
},
|
1748
1789
|
|
1749
1790
|
// single
|
1750
|
-
clear: function() {
|
1791
|
+
clear: function(triggerChange) {
|
1751
1792
|
var data=this.selection.data("select2-data");
|
1752
|
-
|
1753
|
-
|
1754
|
-
|
1755
|
-
|
1793
|
+
if (data) { // guard against queued quick consecutive clicks
|
1794
|
+
this.opts.element.val("");
|
1795
|
+
this.selection.find("span").empty();
|
1796
|
+
this.selection.removeData("select2-data");
|
1797
|
+
this.setPlaceholder();
|
1756
1798
|
|
1757
|
-
|
1758
|
-
|
1799
|
+
if (triggerChange !== false){
|
1800
|
+
this.opts.element.trigger({ type: "removed", val: this.id(data), choice: data });
|
1801
|
+
this.triggerChange({removed:data});
|
1802
|
+
}
|
1803
|
+
}
|
1759
1804
|
},
|
1760
1805
|
|
1761
1806
|
/**
|
@@ -1795,13 +1840,18 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
1795
1840
|
// install default initSelection when applied to hidden input and data is local
|
1796
1841
|
opts.initSelection = opts.initSelection || function (element, callback) {
|
1797
1842
|
var id = element.val();
|
1798
|
-
//search in data by id
|
1843
|
+
//search in data by id, storing the actual matching item
|
1844
|
+
var match = null;
|
1799
1845
|
opts.query({
|
1800
1846
|
matcher: function(term, text, el){
|
1801
|
-
|
1847
|
+
var is_match = equal(id, opts.id(el));
|
1848
|
+
if (is_match) {
|
1849
|
+
match = el;
|
1850
|
+
}
|
1851
|
+
return is_match;
|
1802
1852
|
},
|
1803
|
-
callback: !$.isFunction(callback) ? $.noop : function(
|
1804
|
-
callback(
|
1853
|
+
callback: !$.isFunction(callback) ? $.noop : function() {
|
1854
|
+
callback(match);
|
1805
1855
|
}
|
1806
1856
|
});
|
1807
1857
|
};
|
@@ -1840,7 +1890,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
1840
1890
|
},
|
1841
1891
|
|
1842
1892
|
// single
|
1843
|
-
postprocessResults: function (data, initial) {
|
1893
|
+
postprocessResults: function (data, initial, noHighlightUpdate) {
|
1844
1894
|
var selected = 0, self = this, showSearchInput = true;
|
1845
1895
|
|
1846
1896
|
// find the selected element in the result list
|
@@ -1853,8 +1903,9 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
1853
1903
|
});
|
1854
1904
|
|
1855
1905
|
// and highlight it
|
1856
|
-
|
1857
|
-
|
1906
|
+
if (noHighlightUpdate !== false) {
|
1907
|
+
this.highlight(selected);
|
1908
|
+
}
|
1858
1909
|
|
1859
1910
|
// hide the search box if this is the first we got the results and there are a few of them
|
1860
1911
|
|
@@ -1930,7 +1981,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
1930
1981
|
this.select
|
1931
1982
|
.val(val)
|
1932
1983
|
.find(":selected").each2(function (i, elm) {
|
1933
|
-
data = {id: elm.attr("value"), text: elm.text()};
|
1984
|
+
data = {id: elm.attr("value"), text: elm.text(), element: elm.get(0)};
|
1934
1985
|
return false;
|
1935
1986
|
});
|
1936
1987
|
this.updateSelection(data);
|
@@ -1944,7 +1995,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
1944
1995
|
}
|
1945
1996
|
// val is an id. !val is true for [undefined,null,'',0] - 0 is legal
|
1946
1997
|
if (!val && val !== 0) {
|
1947
|
-
this.clear();
|
1998
|
+
this.clear(triggerChange);
|
1948
1999
|
if (triggerChange) {
|
1949
2000
|
this.triggerChange();
|
1950
2001
|
}
|
@@ -2028,15 +2079,20 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
2028
2079
|
// install default initSelection when applied to hidden input and data is local
|
2029
2080
|
opts.initSelection = opts.initSelection || function (element, callback) {
|
2030
2081
|
var ids = splitVal(element.val(), opts.separator);
|
2031
|
-
//search in data by array of ids
|
2082
|
+
//search in data by array of ids, storing matching items in a list
|
2083
|
+
var matches = [];
|
2032
2084
|
opts.query({
|
2033
2085
|
matcher: function(term, text, el){
|
2034
|
-
|
2086
|
+
var is_match = $.grep(ids, function(id) {
|
2035
2087
|
return equal(id, opts.id(el));
|
2036
2088
|
}).length;
|
2089
|
+
if (is_match) {
|
2090
|
+
matches.push(el);
|
2091
|
+
}
|
2092
|
+
return is_match;
|
2037
2093
|
},
|
2038
|
-
callback: !$.isFunction(callback) ? $.noop : function(
|
2039
|
-
callback(
|
2094
|
+
callback: !$.isFunction(callback) ? $.noop : function() {
|
2095
|
+
callback(matches);
|
2040
2096
|
}
|
2041
2097
|
});
|
2042
2098
|
};
|
@@ -2053,6 +2109,11 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
2053
2109
|
this.searchContainer = this.container.find(".select2-search-field");
|
2054
2110
|
this.selection = selection = this.container.find(selector);
|
2055
2111
|
|
2112
|
+
// rewrite labels from original element to focusser
|
2113
|
+
this.search.attr("id", "s2id_autogen"+nextUid());
|
2114
|
+
$("label[for='" + this.opts.element.attr("id") + "']")
|
2115
|
+
.attr('for', this.search.attr('id'));
|
2116
|
+
|
2056
2117
|
this.search.bind("input paste", this.bind(function() {
|
2057
2118
|
if (!this.enabled) return;
|
2058
2119
|
if (!this.opened()) {
|
@@ -2121,6 +2182,12 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
2121
2182
|
// prevent the page from scrolling
|
2122
2183
|
killEvent(e);
|
2123
2184
|
}
|
2185
|
+
|
2186
|
+
if (e.which === KEY.ENTER) {
|
2187
|
+
// prevent form from being submitted
|
2188
|
+
killEvent(e);
|
2189
|
+
}
|
2190
|
+
|
2124
2191
|
}));
|
2125
2192
|
|
2126
2193
|
this.search.bind("keyup", this.bind(this.resizeSearch));
|
@@ -2204,7 +2271,8 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
2204
2271
|
if (placeholder !== undefined && this.getVal().length === 0 && this.search.hasClass("select2-focused") === false) {
|
2205
2272
|
this.search.val(placeholder).addClass("select2-default");
|
2206
2273
|
// stretch the search box to full width of the container so as much of the placeholder is visible as possible
|
2207
|
-
this.resizeSearch()
|
2274
|
+
// we could call this.resizeSearch(), but we do not because that requires a sizer and we do not want to create one so early because of a firefox bug, see #944
|
2275
|
+
this.search.width(this.getMaxSearchWidth());
|
2208
2276
|
} else {
|
2209
2277
|
this.search.val("").width(10);
|
2210
2278
|
}
|
@@ -2219,10 +2287,11 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
2219
2287
|
|
2220
2288
|
// multi
|
2221
2289
|
opening: function () {
|
2290
|
+
this.clearPlaceholder(); // should be done before super so placeholder is not used to search
|
2291
|
+
this.resizeSearch();
|
2292
|
+
|
2222
2293
|
this.parent.opening.apply(this, arguments);
|
2223
2294
|
|
2224
|
-
this.clearPlaceholder();
|
2225
|
-
this.resizeSearch();
|
2226
2295
|
this.focusSearch();
|
2227
2296
|
|
2228
2297
|
this.opts.element.trigger($.Event("open"));
|
@@ -2238,7 +2307,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
2238
2307
|
focus: function () {
|
2239
2308
|
this.close();
|
2240
2309
|
this.search.focus();
|
2241
|
-
this.opts.element.triggerHandler("focus");
|
2310
|
+
//this.opts.element.triggerHandler("focus");
|
2242
2311
|
},
|
2243
2312
|
|
2244
2313
|
// multi
|
@@ -2266,6 +2335,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
2266
2335
|
self.postprocessResults();
|
2267
2336
|
},
|
2268
2337
|
|
2338
|
+
// multi
|
2269
2339
|
tokenize: function() {
|
2270
2340
|
var input = this.search.val();
|
2271
2341
|
input = this.opts.tokenizer(input, this.data(), this.bind(this.onSelect), this.opts);
|
@@ -2293,7 +2363,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
2293
2363
|
if (this.countSelectableResults()>0) {
|
2294
2364
|
this.search.width(10);
|
2295
2365
|
this.resizeSearch();
|
2296
|
-
if (this.val().length >= this.getMaximumSelectionSize()) {
|
2366
|
+
if (this.getMaximumSelectionSize() > 0 && this.val().length >= this.getMaximumSelectionSize()) {
|
2297
2367
|
// if we reached max selection size repaint the results so choices
|
2298
2368
|
// are replaced with the max selection reached message
|
2299
2369
|
this.updateResults(true);
|
@@ -2431,6 +2501,11 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
2431
2501
|
|
2432
2502
|
},
|
2433
2503
|
|
2504
|
+
// multi
|
2505
|
+
getMaxSearchWidth: function() {
|
2506
|
+
return this.selection.width() - getSideBorderPadding(this.search);
|
2507
|
+
},
|
2508
|
+
|
2434
2509
|
// multi
|
2435
2510
|
resizeSearch: function () {
|
2436
2511
|
var minimumWidth, left, maxWidth, containerLeft, searchWidth,
|
@@ -2656,7 +2731,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
2656
2731
|
formatResultCssClass: function(data) {return undefined;},
|
2657
2732
|
formatNoMatches: function () { return "No matches found"; },
|
2658
2733
|
formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " more character" + (n == 1? "" : "s"); },
|
2659
|
-
formatInputTooLong: function (input, max) { var n = input.length - max; return "Please
|
2734
|
+
formatInputTooLong: function (input, max) { var n = input.length - max; return "Please delete " + n + " character" + (n == 1? "" : "s"); },
|
2660
2735
|
formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); },
|
2661
2736
|
formatLoadMore: function (pageNumber) { return "Loading more results..."; },
|
2662
2737
|
formatSearching: function () { return "Searching..."; },
|
@@ -2666,7 +2741,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
2666
2741
|
maximumSelectionSize: 0,
|
2667
2742
|
id: function (e) { return e.id; },
|
2668
2743
|
matcher: function(term, text) {
|
2669
|
-
return text.toUpperCase().indexOf(term.toUpperCase()) >= 0;
|
2744
|
+
return (''+text).toUpperCase().indexOf((''+term).toUpperCase()) >= 0;
|
2670
2745
|
},
|
2671
2746
|
separator: ",",
|
2672
2747
|
tokenSeparators: [],
|
@@ -2682,7 +2757,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|
2682
2757
|
"/": '/'
|
2683
2758
|
};
|
2684
2759
|
|
2685
|
-
return String(markup).replace(/[&<>"'
|
2760
|
+
return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
|
2686
2761
|
return replace_map[match[0]];
|
2687
2762
|
});
|
2688
2763
|
},
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
Version: 3.3.
|
2
|
+
Version: 3.3.2 Timestamp: Mon Mar 25 12:14:18 PDT 2013
|
3
3
|
*/
|
4
4
|
.select2-container {
|
5
5
|
position: relative;
|
@@ -7,7 +7,7 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
|
7
7
|
/* inline-block for ie7 */
|
8
8
|
zoom: 1;
|
9
9
|
*display: inline;
|
10
|
-
vertical-align:
|
10
|
+
vertical-align: middle;
|
11
11
|
}
|
12
12
|
|
13
13
|
.select2-container,
|
@@ -119,7 +119,11 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
|
119
119
|
left: 0;
|
120
120
|
top: 0;
|
121
121
|
z-index: 9998;
|
122
|
+
background-color: #fff;
|
122
123
|
opacity: 0;
|
124
|
+
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; /* works in IE 8 */
|
125
|
+
filter: "alpha(opacity=0)"; /* expected to work in IE 8 */
|
126
|
+
filter: alpha(opacity=0); /* IE 4-7 */
|
123
127
|
}
|
124
128
|
|
125
129
|
.select2-drop {
|
@@ -335,6 +339,8 @@ Version: 3.3.1 Timestamp: Wed Feb 20 09:57:22 PST 2013
|
|
335
339
|
margin: 0;
|
336
340
|
cursor: pointer;
|
337
341
|
|
342
|
+
min-height: 1em;
|
343
|
+
|
338
344
|
-webkit-touch-callout: none;
|
339
345
|
-webkit-user-select: none;
|
340
346
|
-khtml-user-select: none;
|
@@ -585,8 +591,14 @@ disabled look for disabled choices in the results dropdown
|
|
585
591
|
}
|
586
592
|
|
587
593
|
.select2-offscreen {
|
594
|
+
border: 0;
|
595
|
+
clip: rect(0 0 0 0);
|
596
|
+
height: 1px;
|
597
|
+
margin: -1px;
|
598
|
+
overflow: hidden;
|
599
|
+
padding: 0;
|
588
600
|
position: absolute;
|
589
|
-
|
601
|
+
width: 1px;
|
590
602
|
}
|
591
603
|
|
592
604
|
/* Retina-ize icons */
|
@@ -601,3 +613,4 @@ disabled look for disabled choices in the results dropdown
|
|
601
613
|
background-position: 100% -21px !important;
|
602
614
|
}
|
603
615
|
}
|
616
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: select2-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-05-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: thor
|