select2-rails 3.5.9.3 → 3.5.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45a51cd138f4061db35c67941d59577cfb2effb9
4
- data.tar.gz: ba4b06edc8fb49619bba17800a430ee517e62588
3
+ metadata.gz: 61c9e3939e4e444390089b9dacb6ac6d953df32e
4
+ data.tar.gz: 29be608e120f118cc931776616b7daf7a48f2c59
5
5
  SHA512:
6
- metadata.gz: 7c892de7958c6703d5716030adb47d50bc2450e16c518a52f7efe44167a423e73a9c54de19309fa4fb047525cc34b2c5bddd136ae72b4128bbabde86bcd60eda
7
- data.tar.gz: 0f2355b3cb2a448270672954627009ae37cbab80bbd128b36f40820321d3f0e0f963f02e29a2e96992068a3a077dff44a10d356eb80f7f90728ffa25e813b399
6
+ metadata.gz: 2bf9acdc28ff60bf0726b5eace683f32f78713b6983c53ce5cb1ff99ccb3b268870ed5c96902ecd4c7bf06e744b9884f86f6169833cb12dbe0cefc1b46fabef5
7
+ data.tar.gz: d204594781a00a38d902592087e229d5722c3b6edc69c72ae0ca5f68a523c82375f35280f9091c43c4158ca8a6694396056b21610bd2fa7dbbc9e82695dc9f60
data/README.md CHANGED
@@ -65,9 +65,9 @@ The last number of the version is the patch version specific to the gem. For exa
65
65
 
66
66
  If you want to contribute, please:
67
67
 
68
- * Fork the project.
69
- * Make your feature addition or bug fix.
70
- * Send me a pull request on Github.
68
+ * Fork the project.
69
+ * Make your feature addition or bug fix.
70
+ * Send me a pull request on Github.
71
71
 
72
72
  ## License
73
73
 
@@ -1,5 +1,5 @@
1
1
  module Select2
2
2
  module Rails
3
- VERSION = "3.5.9.3"
3
+ VERSION = "3.5.10"
4
4
  end
5
5
  end
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  Copyright 2012 Igor Vaynberg
3
3
 
4
- Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014
4
+ Version: 3.5.4 Timestamp: Sun Aug 30 13:30:32 EDT 2015
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
@@ -814,7 +814,7 @@ the specific language governing permissions and limitations under the Apache Lic
814
814
  // focusin can cause focus wars between modals and select2 since the dropdown is outside the modal.
815
815
  this.dropdown.on("click mouseup mousedown touchstart touchend focusin", function (e) { e.stopPropagation(); });
816
816
 
817
- this.nextSearchTerm = undefined;
817
+ this.lastSearchTerm = undefined;
818
818
 
819
819
  if ($.isFunction(this.opts.initSelection)) {
820
820
  // initialize selection based on the current value of the source element
@@ -870,17 +870,21 @@ the specific language governing permissions and limitations under the Apache Lic
870
870
  select2.container.remove();
871
871
  select2.liveRegion.remove();
872
872
  select2.dropdown.remove();
873
- element
874
- .show()
875
- .removeData("select2")
876
- .off(".select2")
877
- .prop("autofocus", this.autofocus || false);
878
- if (this.elementTabIndex) {
879
- element.attr({tabindex: this.elementTabIndex});
873
+ element.removeData("select2")
874
+ .off(".select2");
875
+ if (!element.is("input[type='hidden']")) {
876
+ element
877
+ .show()
878
+ .prop("autofocus", this.autofocus || false);
879
+ if (this.elementTabIndex) {
880
+ element.attr({tabindex: this.elementTabIndex});
881
+ } else {
882
+ element.removeAttr("tabindex");
883
+ }
884
+ element.show();
880
885
  } else {
881
- element.removeAttr("tabindex");
886
+ element.css("display", "");
882
887
  }
883
- element.show();
884
888
  }
885
889
 
886
890
  cleanupJQueryElements.call(this,
@@ -932,6 +936,155 @@ the specific language governing permissions and limitations under the Apache Lic
932
936
  });
933
937
  }
934
938
 
939
+ opts.debug = opts.debug || $.fn.select2.defaults.debug;
940
+
941
+ // Warnings for options renamed/removed in Select2 4.0.0
942
+ // Only when it's enabled through debug mode
943
+ if (opts.debug && console && console.warn) {
944
+ // id was removed
945
+ if (opts.id != null) {
946
+ console.warn(
947
+ 'Select2: The `id` option has been removed in Select2 4.0.0, ' +
948
+ 'consider renaming your `id` property or mapping the property before your data makes it to Select2. ' +
949
+ 'You can read more at https://select2.github.io/announcements-4.0.html#changed-id'
950
+ );
951
+ }
952
+
953
+ // text was removed
954
+ if (opts.text != null) {
955
+ console.warn(
956
+ 'Select2: The `text` option has been removed in Select2 4.0.0, ' +
957
+ 'consider renaming your `text` property or mapping the property before your data makes it to Select2. ' +
958
+ 'You can read more at https://select2.github.io/announcements-4.0.html#changed-id'
959
+ );
960
+ }
961
+
962
+ // sortResults was renamed to results
963
+ if (opts.sortResults != null) {
964
+ console.warn(
965
+ 'Select2: the `sortResults` option has been renamed to `sorter` in Select2 4.0.0. '
966
+ );
967
+ }
968
+
969
+ // selectOnBlur was renamed to selectOnClose
970
+ if (opts.selectOnBlur != null) {
971
+ console.warn(
972
+ 'Select2: The `selectOnBlur` option has been renamed to `selectOnClose` in Select2 4.0.0.'
973
+ );
974
+ }
975
+
976
+ // ajax.results was renamed to ajax.processResults
977
+ if (opts.ajax != null && opts.ajax.results != null) {
978
+ console.warn(
979
+ 'Select2: The `ajax.results` option has been renamed to `ajax.processResults` in Select2 4.0.0.'
980
+ );
981
+ }
982
+
983
+ // format* options were renamed to language.*
984
+ if (opts.formatNoResults != null) {
985
+ console.warn(
986
+ 'Select2: The `formatNoResults` option has been renamed to `language.noResults` in Select2 4.0.0.'
987
+ );
988
+ }
989
+ if (opts.formatSearching != null) {
990
+ console.warn(
991
+ 'Select2: The `formatSearching` option has been renamed to `language.searching` in Select2 4.0.0.'
992
+ );
993
+ }
994
+ if (opts.formatInputTooShort != null) {
995
+ console.warn(
996
+ 'Select2: The `formatInputTooShort` option has been renamed to `language.inputTooShort` in Select2 4.0.0.'
997
+ );
998
+ }
999
+ if (opts.formatInputTooLong != null) {
1000
+ console.warn(
1001
+ 'Select2: The `formatInputTooLong` option has been renamed to `language.inputTooLong` in Select2 4.0.0.'
1002
+ );
1003
+ }
1004
+ if (opts.formatLoading != null) {
1005
+ console.warn(
1006
+ 'Select2: The `formatLoading` option has been renamed to `language.loadingMore` in Select2 4.0.0.'
1007
+ );
1008
+ }
1009
+ if (opts.formatSelectionTooBig != null) {
1010
+ console.warn(
1011
+ 'Select2: The `formatSelectionTooBig` option has been renamed to `language.maximumSelected` in Select2 4.0.0.'
1012
+ );
1013
+ }
1014
+
1015
+ if (opts.element.data('select2Tags')) {
1016
+ console.warn(
1017
+ 'Select2: The `data-select2-tags` attribute has been renamed to `data-tags` in Select2 4.0.0.'
1018
+ );
1019
+ }
1020
+ }
1021
+
1022
+ // Aliasing options renamed in Select2 4.0.0
1023
+
1024
+ // data-select2-tags -> data-tags
1025
+ if (opts.element.data('tags') != null) {
1026
+ var elemTags = opts.element.data('tags');
1027
+
1028
+ // data-tags should actually be a boolean
1029
+ if (!$.isArray(elemTags)) {
1030
+ elemTags = [];
1031
+ }
1032
+
1033
+ opts.element.data('select2Tags', elemTags);
1034
+ }
1035
+
1036
+ // sortResults -> sorter
1037
+ if (opts.sorter != null) {
1038
+ opts.sortResults = opts.sorter;
1039
+ }
1040
+
1041
+ // selectOnBlur -> selectOnClose
1042
+ if (opts.selectOnClose != null) {
1043
+ opts.selectOnBlur = opts.selectOnClose;
1044
+ }
1045
+
1046
+ // ajax.results -> ajax.processResults
1047
+ if (opts.ajax != null) {
1048
+ if ($.isFunction(opts.ajax.processResults)) {
1049
+ opts.ajax.results = opts.ajax.processResults;
1050
+ }
1051
+ }
1052
+
1053
+ // Formatters/language options
1054
+ if (opts.language != null) {
1055
+ var lang = opts.language;
1056
+
1057
+ // formatNoMatches -> language.noMatches
1058
+ if ($.isFunction(lang.noMatches)) {
1059
+ opts.formatNoMatches = lang.noMatches;
1060
+ }
1061
+
1062
+ // formatSearching -> language.searching
1063
+ if ($.isFunction(lang.searching)) {
1064
+ opts.formatSearching = lang.searching;
1065
+ }
1066
+
1067
+ // formatInputTooShort -> language.inputTooShort
1068
+ if ($.isFunction(lang.inputTooShort)) {
1069
+ opts.formatInputTooShort = lang.inputTooShort;
1070
+ }
1071
+
1072
+ // formatInputTooLong -> language.inputTooLong
1073
+ if ($.isFunction(lang.inputTooLong)) {
1074
+ opts.formatInputTooLong = lang.inputTooLong;
1075
+ }
1076
+
1077
+ // formatLoading -> language.loadingMore
1078
+ if ($.isFunction(lang.loadingMore)) {
1079
+ opts.formatLoading = lang.loadingMore;
1080
+ }
1081
+
1082
+ // formatSelectionTooBig -> language.maximumSelected
1083
+ if ($.isFunction(lang.maximumSelected)) {
1084
+ opts.formatSelectionTooBig = lang.maximumSelected;
1085
+ }
1086
+ }
1087
+
935
1088
  opts = $.extend({}, {
936
1089
  populateResults: function(container, results, query) {
937
1090
  var populate, id=this.opts.id, liveRegion=this.liveRegion;
@@ -975,7 +1128,6 @@ the specific language governing permissions and limitations under the Apache Lic
975
1128
 
976
1129
 
977
1130
  if (compound) {
978
-
979
1131
  innerContainer=$("<ul></ul>");
980
1132
  innerContainer.addClass("select2-result-sub");
981
1133
  populate(result.children, innerContainer, depth+1);
@@ -1046,7 +1198,6 @@ the specific language governing permissions and limitations under the Apache Lic
1046
1198
  opts.id=function(e) { return e.id; };
1047
1199
  } else {
1048
1200
  if (!("query" in opts)) {
1049
-
1050
1201
  if ("ajax" in opts) {
1051
1202
  ajaxUrl = opts.element.data("ajax-url");
1052
1203
  if (ajaxUrl && ajaxUrl.length > 0) {
@@ -1325,10 +1476,11 @@ the specific language governing permissions and limitations under the Apache Lic
1325
1476
  };
1326
1477
 
1327
1478
  if (above) {
1328
- css.top = offset.top - dropHeight;
1329
- css.bottom = 'auto';
1330
1479
  this.container.addClass("select2-drop-above");
1331
1480
  $dropdown.addClass("select2-drop-above");
1481
+ dropHeight = $dropdown.outerHeight(false);
1482
+ css.top = offset.top - dropHeight;
1483
+ css.bottom = 'auto';
1332
1484
  }
1333
1485
  else {
1334
1486
  css.top = dropTop;
@@ -1481,6 +1633,9 @@ the specific language governing permissions and limitations under the Apache Lic
1481
1633
 
1482
1634
  this.clearSearch();
1483
1635
  this.search.removeClass("select2-active");
1636
+
1637
+ // Remove the aria active descendant for highlighted element
1638
+ this.search.removeAttr("aria-activedescendant");
1484
1639
  this.opts.element.trigger($.Event("select2-close"));
1485
1640
  },
1486
1641
 
@@ -1499,6 +1654,27 @@ the specific language governing permissions and limitations under the Apache Lic
1499
1654
 
1500
1655
  },
1501
1656
 
1657
+ /**
1658
+ * @return {Boolean} Whether or not search value was changed.
1659
+ * @private
1660
+ */
1661
+ prefillNextSearchTerm: function () {
1662
+ // initializes search's value with nextSearchTerm (if defined by user)
1663
+ // ignore nextSearchTerm if the dropdown is opened by the user pressing a letter
1664
+ if(this.search.val() !== "") {
1665
+ return false;
1666
+ }
1667
+
1668
+ var nextSearchTerm = this.opts.nextSearchTerm(this.data(), this.lastSearchTerm);
1669
+ if(nextSearchTerm !== undefined){
1670
+ this.search.val(nextSearchTerm);
1671
+ this.search.select();
1672
+ return true;
1673
+ }
1674
+
1675
+ return false;
1676
+ },
1677
+
1502
1678
  //abstract
1503
1679
  getMaximumSelectionSize: function() {
1504
1680
  return evaluate(this.opts.maximumSelectionSize, this.opts.element);
@@ -1812,6 +1988,9 @@ the specific language governing permissions and limitations under the Apache Lic
1812
1988
 
1813
1989
  if (data.results.length === 0 && checkFormatter(opts.formatNoMatches, "formatNoMatches")) {
1814
1990
  render("<li class='select2-no-results'>" + evaluate(opts.formatNoMatches, opts.element, search.val()) + "</li>");
1991
+ if(this.showSearch){
1992
+ this.showSearch(search.val());
1993
+ }
1815
1994
  return;
1816
1995
  }
1817
1996
 
@@ -1916,7 +2095,7 @@ the specific language governing permissions and limitations under the Apache Lic
1916
2095
  } else if (this.opts.width === "copy" || this.opts.width === "resolve") {
1917
2096
  // check if there is inline style on the element that contains width
1918
2097
  style = this.opts.element.attr('style');
1919
- if (style !== undefined) {
2098
+ if (typeof(style) === "string") {
1920
2099
  attrs = style.split(';');
1921
2100
  for (i = 0, l = attrs.length; i < l; i = i + 1) {
1922
2101
  attr = attrs[i].replace(/\s/g, '');
@@ -2015,14 +2194,7 @@ the specific language governing permissions and limitations under the Apache Lic
2015
2194
  }
2016
2195
  }
2017
2196
 
2018
- // initializes search's value with nextSearchTerm (if defined by user)
2019
- // ignore nextSearchTerm if the dropdown is opened by the user pressing a letter
2020
- if(this.search.val() === "") {
2021
- if(this.nextSearchTerm != undefined){
2022
- this.search.val(this.nextSearchTerm);
2023
- this.search.select();
2024
- }
2025
- }
2197
+ this.prefillNextSearchTerm();
2026
2198
 
2027
2199
  this.focusser.prop("disabled", true).val("");
2028
2200
  this.updateResults(true);
@@ -2109,7 +2281,7 @@ the specific language governing permissions and limitations under the Apache Lic
2109
2281
  this.focusser.attr("id", "s2id_autogen"+idSuffix);
2110
2282
 
2111
2283
  elementLabel = $("label[for='" + this.opts.element.attr("id") + "']");
2112
- this.opts.element.focus(this.bind(function () { this.focus(); }));
2284
+ this.opts.element.on('focus.select2', this.bind(function () { this.focus(); }));
2113
2285
 
2114
2286
  this.focusser.prev()
2115
2287
  .text(elementLabel.text())
@@ -2165,7 +2337,7 @@ the specific language governing permissions and limitations under the Apache Lic
2165
2337
  // without this the search field loses focus which is annoying
2166
2338
  if (document.activeElement === this.body.get(0)) {
2167
2339
  window.setTimeout(this.bind(function() {
2168
- if (this.opened()) {
2340
+ if (this.opened() && this.results && this.results.length > 1) {
2169
2341
  this.search.focus();
2170
2342
  }
2171
2343
  }), 0);
@@ -2317,7 +2489,7 @@ the specific language governing permissions and limitations under the Apache Lic
2317
2489
  self.updateSelection(selected);
2318
2490
  self.close();
2319
2491
  self.setPlaceholder();
2320
- self.nextSearchTerm = self.opts.nextSearchTerm(selected, self.search.val());
2492
+ self.lastSearchTerm = self.search.val();
2321
2493
  }
2322
2494
  });
2323
2495
  }
@@ -2454,7 +2626,7 @@ the specific language governing permissions and limitations under the Apache Lic
2454
2626
 
2455
2627
  this.opts.element.trigger({ type: "select2-selected", val: this.id(data), choice: data });
2456
2628
 
2457
- this.nextSearchTerm = this.opts.nextSearchTerm(data, this.search.val());
2629
+ this.lastSearchTerm = this.search.val();
2458
2630
  this.close();
2459
2631
 
2460
2632
  if ((!options || !options.noFocus) && this.opts.shouldFocusInput(this)) {
@@ -2508,9 +2680,23 @@ the specific language governing permissions and limitations under the Apache Lic
2508
2680
 
2509
2681
  if (arguments.length > 1) {
2510
2682
  triggerChange = arguments[1];
2683
+
2684
+ if (this.opts.debug && console && console.warn) {
2685
+ console.warn(
2686
+ 'Select2: The second option to `select2("val")` is not supported in Select2 4.0.0. ' +
2687
+ 'The `change` event will always be triggered in 4.0.0.'
2688
+ );
2689
+ }
2511
2690
  }
2512
2691
 
2513
2692
  if (this.select) {
2693
+ if (this.opts.debug && console && console.warn) {
2694
+ console.warn(
2695
+ 'Select2: Setting the value on a <select> using `select2("val")` is no longer supported in 4.0.0. ' +
2696
+ 'You can use the `.val(newValue).trigger("change")` method provided by jQuery instead.'
2697
+ );
2698
+ }
2699
+
2514
2700
  this.select
2515
2701
  .val(val)
2516
2702
  .find("option").filter(function() { return this.selected }).each2(function (i, elm) {
@@ -2559,6 +2745,13 @@ the specific language governing permissions and limitations under the Apache Lic
2559
2745
  if (data == undefined) data = null;
2560
2746
  return data;
2561
2747
  } else {
2748
+ if (this.opts.debug && console && console.warn) {
2749
+ console.warn(
2750
+ 'Select2: The `select2("data")` method can no longer set selected values in 4.0.0, ' +
2751
+ 'consider using the `.val()` method instead.'
2752
+ );
2753
+ }
2754
+
2562
2755
  if (arguments.length > 1) {
2563
2756
  triggerChange = arguments[1];
2564
2757
  }
@@ -2704,7 +2897,7 @@ the specific language governing permissions and limitations under the Apache Lic
2704
2897
  this.search.prev()
2705
2898
  .text($("label[for='" + this.opts.element.attr("id") + "']").text())
2706
2899
  .attr('for', this.search.attr('id'));
2707
- this.opts.element.focus(this.bind(function () { this.focus(); }));
2900
+ this.opts.element.on('focus.select2', this.bind(function () { this.focus(); }));
2708
2901
 
2709
2902
  this.search.on("input paste", this.bind(function() {
2710
2903
  if (this.search.attr('placeholder') && this.search.val().length == 0) return;
@@ -2922,16 +3115,9 @@ the specific language governing permissions and limitations under the Apache Lic
2922
3115
 
2923
3116
  this.focusSearch();
2924
3117
 
2925
- // initializes search's value with nextSearchTerm (if defined by user)
2926
- // ignore nextSearchTerm if the dropdown is opened by the user pressing a letter
2927
- if(this.search.val() === "") {
2928
- if(this.nextSearchTerm != undefined){
2929
- this.search.val(this.nextSearchTerm);
2930
- this.search.select();
2931
- }
2932
- }
2933
-
3118
+ this.prefillNextSearchTerm();
2934
3119
  this.updateResults(true);
3120
+
2935
3121
  if (this.opts.shouldFocusInput(this)) {
2936
3122
  this.search.focus();
2937
3123
  }
@@ -2957,21 +3143,18 @@ the specific language governing permissions and limitations under the Apache Lic
2957
3143
 
2958
3144
  // multi
2959
3145
  updateSelection: function (data) {
2960
- var ids = [], filtered = [], self = this;
3146
+ var ids = {}, filtered = [], self = this;
2961
3147
 
2962
3148
  // filter out duplicates
2963
3149
  $(data).each(function () {
2964
- if (indexOf(self.id(this), ids) < 0) {
2965
- ids.push(self.id(this));
3150
+ if (!(self.id(this) in ids)) {
3151
+ ids[self.id(this)] = 0;
2966
3152
  filtered.push(this);
2967
3153
  }
2968
3154
  });
2969
- data = filtered;
2970
3155
 
2971
3156
  this.selection.find(".select2-search-choice").remove();
2972
- $(data).each(function () {
2973
- self.addSelectedChoice(this);
2974
- });
3157
+ this.addSelectedChoice(filtered);
2975
3158
  self.postprocessResults();
2976
3159
  },
2977
3160
 
@@ -2998,7 +3181,7 @@ the specific language governing permissions and limitations under the Apache Lic
2998
3181
  this.opts.element.trigger({ type: "selected", val: this.id(data), choice: data });
2999
3182
 
3000
3183
  // keep track of the search's value before it gets cleared
3001
- this.nextSearchTerm = this.opts.nextSearchTerm(data, this.search.val());
3184
+ this.lastSearchTerm = this.search.val();
3002
3185
 
3003
3186
  this.clearSearch();
3004
3187
  this.updateResults();
@@ -3018,10 +3201,8 @@ the specific language governing permissions and limitations under the Apache Lic
3018
3201
  this.updateResults(true);
3019
3202
  } else {
3020
3203
  // initializes search's value with nextSearchTerm and update search result
3021
- if(this.nextSearchTerm != undefined){
3022
- this.search.val(this.nextSearchTerm);
3204
+ if (this.prefillNextSearchTerm()) {
3023
3205
  this.updateResults();
3024
- this.search.select();
3025
3206
  }
3026
3207
  }
3027
3208
  this.positionDropdown();
@@ -3047,6 +3228,14 @@ the specific language governing permissions and limitations under the Apache Lic
3047
3228
  },
3048
3229
 
3049
3230
  addSelectedChoice: function (data) {
3231
+ var val = this.getVal(), self = this;
3232
+ $(data).each(function () {
3233
+ val.push(self.createChoice(this));
3234
+ });
3235
+ this.setVal(val);
3236
+ },
3237
+
3238
+ createChoice: function (data) {
3050
3239
  var enableChoice = !data.locked,
3051
3240
  enabledItem = $(
3052
3241
  "<li class='select2-search-choice'>" +
@@ -3059,7 +3248,6 @@ the specific language governing permissions and limitations under the Apache Lic
3059
3248
  "</li>");
3060
3249
  var choice = enableChoice ? enabledItem : disabledItem,
3061
3250
  id = this.id(data),
3062
- val = this.getVal(),
3063
3251
  formatted,
3064
3252
  cssClass;
3065
3253
 
@@ -3093,8 +3281,7 @@ the specific language governing permissions and limitations under the Apache Lic
3093
3281
  choice.data("select2-data", data);
3094
3282
  choice.insertBefore(this.searchContainer);
3095
3283
 
3096
- val.push(id);
3097
- this.setVal(val);
3284
+ return id;
3098
3285
  },
3099
3286
 
3100
3287
  // multi
@@ -3226,14 +3413,16 @@ the specific language governing permissions and limitations under the Apache Lic
3226
3413
 
3227
3414
  // multi
3228
3415
  setVal: function (val) {
3229
- var unique;
3230
3416
  if (this.select) {
3231
3417
  this.select.val(val);
3232
3418
  } else {
3233
- unique = [];
3419
+ var unique = [], valMap = {};
3234
3420
  // filter out duplicates
3235
3421
  $(val).each(function () {
3236
- if (indexOf(this, unique) < 0) unique.push(this);
3422
+ if (!(this in valMap)) {
3423
+ unique.push(this);
3424
+ valMap[this] = 0;
3425
+ }
3237
3426
  });
3238
3427
  this.opts.element.val(unique.length === 0 ? "" : unique.join(this.opts.separator));
3239
3428
  }
@@ -3249,11 +3438,9 @@ the specific language governing permissions and limitations under the Apache Lic
3249
3438
  for (var j = 0; j < old.length; j++) {
3250
3439
  if (equal(this.opts.id(current[i]), this.opts.id(old[j]))) {
3251
3440
  current.splice(i, 1);
3252
- if(i>0){
3253
- i--;
3254
- }
3441
+ i--;
3255
3442
  old.splice(j, 1);
3256
- j--;
3443
+ break;
3257
3444
  }
3258
3445
  }
3259
3446
  }
@@ -3423,6 +3610,7 @@ the specific language governing permissions and limitations under the Apache Lic
3423
3610
 
3424
3611
  // plugin defaults, accessible to users
3425
3612
  $.fn.select2.defaults = {
3613
+ debug: false,
3426
3614
  width: "copy",
3427
3615
  loadMorePadding: 0,
3428
3616
  closeOnSelect: true,
@@ -2,15 +2,17 @@
2
2
  * Select2 Indonesian translation.
3
3
  *
4
4
  * Author: Ibrahim Yusuf <ibrahim7usuf@gmail.com>
5
+ * Author: Salahuddin Hairai <mr.od3n@gmail.com>
5
6
  */
6
7
  (function ($) {
7
8
  "use strict";
8
9
 
9
10
  $.fn.select2.locales['id'] = {
11
+ formatMatches: function (matches) { if (matches === 1) { return "Satu keputusan ditemui, tekan enter untuk memilih."; } return matches + " keputusan ditemui, gunakan kekunci anak panah ke atas dan ke bawah untuk menavigasi."; },
10
12
  formatNoMatches: function () { return "Tidak ada data yang sesuai"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Masukkan " + n + " huruf lagi" + (n == 1 ? "" : "s"); },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Hapus " + n + " huruf" + (n == 1 ? "" : "s"); },
13
- formatSelectionTooBig: function (limit) { return "Anda hanya dapat memilih " + limit + " pilihan" + (limit == 1 ? "" : "s"); },
13
+ formatInputTooShort: function (input, min) { var n = min - input.length; return "Masukkan " + n + " huruf lagi"; },
14
+ formatInputTooLong: function (input, max) { var n = input.length - max; return "Hapuskan " + n + " huruf" ; },
15
+ formatSelectionTooBig: function (limit) { return "Anda hanya dapat memilih " + limit + " pilihan"; },
14
16
  formatLoadMore: function (pageNumber) { return "Mengambil data…"; },
15
17
  formatSearching: function () { return "Mencari…"; }
16
18
  };
@@ -2,11 +2,13 @@
2
2
  * Select2 Malay translation.
3
3
  *
4
4
  * Author: Kepoweran <kepoweran@gmail.com>
5
+ * Author: Salahuddin Hairai <mr.od3n@gmail.com>
5
6
  */
6
7
  (function ($) {
7
8
  "use strict";
8
9
 
9
10
  $.fn.select2.locales['ms'] = {
11
+ formatMatches: function (matches) { if (matches === 1) { return "Satu keputusan ditemui, tekan enter untuk memilih."; } return matches + " keputusan ditemui, gunakan kekunci anak panah ke atas dan ke bawah untuk menavigasi."; },
10
12
  formatNoMatches: function () { return "Tiada padanan yang ditemui"; },
11
13
  formatInputTooShort: function (input, min) { var n = min - input.length; return "Sila masukkan " + n + " aksara lagi"; },
12
14
  formatInputTooLong: function (input, max) { var n = input.length - max; return "Sila hapuskan " + n + " aksara"; },
@@ -7,6 +7,7 @@
7
7
  "use strict";
8
8
 
9
9
  $.fn.select2.locales['tr'] = {
10
+ formatMatches: function (matches) { if (matches === 1) { return "Sadece bir sonuç bulundu, seçmek için enter tuşuna basabilirsiniz."; } return matches + " sonuç bulundu, yukarı ve aşağı tuşları ile seçebilirsiniz."; },
10
11
  formatNoMatches: function () { return "Sonuç bulunamadı"; },
11
12
  formatInputTooShort: function (input, min) { var n = min - input.length; return "En az " + n + " karakter daha girmelisiniz"; },
12
13
  formatInputTooLong: function (input, max) { var n = input.length - max; return n + " karakter azaltmalısınız"; },
@@ -1,16 +1,16 @@
1
1
  /**
2
2
  * Select2 Vietnamese translation.
3
3
  *
4
- * Author: Long Nguyen <olragon@gmail.com>
4
+ * Author: Long Nguyen <olragon@gmail.com>, Nguyen Chien Cong
5
5
  */
6
6
  (function ($) {
7
7
  "use strict";
8
8
 
9
9
  $.fn.select2.locales['vi'] = {
10
10
  formatNoMatches: function () { return "Không tìm thấy kết quả"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Vui lòng nhập nhiều hơn " + n + " ký tự" + (n == 1 ? "" : "s"); },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Vui lòng nhập ít hơn " + n + " ký tự" + (n == 1? "" : "s"); },
13
- formatSelectionTooBig: function (limit) { return "Chỉ có thể chọn được " + limit + " tùy chọn" + (limit == 1 ? "" : "s"); },
11
+ formatInputTooShort: function (input, min) { var n = min - input.length; return "Vui lòng nhập nhiều hơn " + n + " ký tự"; },
12
+ formatInputTooLong: function (input, max) { var n = input.length - max; return "Vui lòng nhập ít hơn " + n + " ký tự"; },
13
+ formatSelectionTooBig: function (limit) { return "Chỉ có thể chọn được " + limit + " lựa chọn"; },
14
14
  formatLoadMore: function (pageNumber) { return "Đang lấy thêm kết quả…"; },
15
15
  formatSearching: function () { return "Đang tìm…"; }
16
16
  };
@@ -1,497 +1,87 @@
1
- /**
2
- * Select2 Bootstrap 3 CSS v1.4.1
3
- * Tested with Bootstrap v3.2.0 and Select2 v3.3.2, v3.4.1-v3.4.5, v3.5.1, master
4
- * in latest Chrome, Safari, Firefox, Opera (Mac) and IE8-IE11
5
- * MIT License
6
- */
7
- /**
8
- * Reset Bootstrap 3 .form-control styles which - if applied to the
9
- * original <select>-element the Select2-plugin may be run against -
10
- * are copied to the .select2-container.
11
- *
12
- * 1. Overwrite .select2-container's original display:inline-block
13
- * with Bootstrap 3's default for .form-control, display:block;
14
- * courtesy of @juristr (@see https://github.com/fk/select2-bootstrap-css/pull/1)
15
- */
16
- .select2-container.form-control {
17
- background: transparent;
18
- border: none;
19
- display: block;
20
- /* 1 */
21
- margin: 0;
22
- padding: 0;
1
+ .form-control .select2-choice {
2
+ border: 0;
3
+ border-radius: 2px;
23
4
  }
24
5
 
25
- /**
26
- * Adjust Select2 inputs to fit Bootstrap 3 default .form-control appearance.
27
- */
28
- .select2-container .select2-choices .select2-search-field input,
29
- .select2-container .select2-choice,
30
- .select2-container .select2-choices {
31
- background: none;
32
- padding: 0;
33
- border-color: #cccccc;
34
- border-radius: 4px;
35
- color: #555555;
36
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
37
- background-color: white;
38
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
39
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
40
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
6
+ .form-control .select2-choice .select2-arrow {
7
+ border-radius: 0 2px 2px 0;
41
8
  }
42
9
 
43
- .select2-search input {
44
- border-color: #cccccc;
45
- border-radius: 4px;
46
- color: #555555;
47
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
48
- background-color: white;
49
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
50
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
51
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
10
+ .form-control.select2-container {
11
+ height: auto !important;
12
+ padding: 0;
52
13
  }
53
14
 
54
- .select2-container .select2-choices .select2-search-field input {
55
- -webkit-box-shadow: none;
56
- box-shadow: none;
15
+ .form-control.select2-container.select2-dropdown-open {
16
+ border-color: #5897FB;
17
+ border-radius: 3px 3px 0 0;
57
18
  }
58
19
 
59
- /**
60
- * Adjust Select2 input heights to match the Bootstrap default.
61
- */
62
- .select2-container .select2-choice {
63
- height: 34px;
64
- line-height: 1.42857;
20
+ .form-control .select2-container.select2-dropdown-open .select2-choices {
21
+ border-radius: 3px 3px 0 0;
65
22
  }
66
23
 
67
- /**
68
- * Address Multi Select2's height which - depending on how many elements have been selected -
69
- * may grown higher than their initial size.
70
- */
71
- .select2-container.select2-container-multi.form-control {
72
- height: auto;
24
+ .form-control.select2-container .select2-choices {
25
+ border: 0 !important;
26
+ border-radius: 3px;
73
27
  }
74
28
 
75
- /**
76
- * Address Bootstrap 3 control sizing classes
77
- * @see http://getbootstrap.com/css/#forms-control-sizes
78
- */
79
- .select2-container.input-sm .select2-choice,
80
- .input-group-sm .select2-container .select2-choice {
81
- height: 30px;
82
- line-height: 1.5;
83
- border-radius: 3px;
29
+ .control-group.warning .select2-container .select2-choice,
30
+ .control-group.warning .select2-container .select2-choices,
31
+ .control-group.warning .select2-container-active .select2-choice,
32
+ .control-group.warning .select2-container-active .select2-choices,
33
+ .control-group.warning .select2-dropdown-open.select2-drop-above .select2-choice,
34
+ .control-group.warning .select2-dropdown-open.select2-drop-above .select2-choices,
35
+ .control-group.warning .select2-container-multi.select2-container-active .select2-choices {
36
+ border: 1px solid #C09853 !important;
84
37
  }
85
38
 
86
- .select2-container.input-lg .select2-choice,
87
- .input-group-lg .select2-container .select2-choice {
88
- height: 46px;
89
- line-height: 1.33;
90
- border-radius: 6px;
39
+ .control-group.warning .select2-container .select2-choice div {
40
+ border-left: 1px solid #C09853 !important;
41
+ background: #FCF8E3 !important;
91
42
  }
92
43
 
93
- .select2-container-multi .select2-choices .select2-search-field input {
94
- height: 32px;
44
+ .control-group.error .select2-container .select2-choice,
45
+ .control-group.error .select2-container .select2-choices,
46
+ .control-group.error .select2-container-active .select2-choice,
47
+ .control-group.error .select2-container-active .select2-choices,
48
+ .control-group.error .select2-dropdown-open.select2-drop-above .select2-choice,
49
+ .control-group.error .select2-dropdown-open.select2-drop-above .select2-choices,
50
+ .control-group.error .select2-container-multi.select2-container-active .select2-choices {
51
+ border: 1px solid #B94A48 !important;
95
52
  }
96
53
 
97
- .select2-container-multi.input-sm .select2-choices .select2-search-field input,
98
- .input-group-sm .select2-container-multi .select2-choices .select2-search-field input {
99
- height: 28px;
54
+ .control-group.error .select2-container .select2-choice div {
55
+ border-left: 1px solid #B94A48 !important;
56
+ background: #F2DEDE !important;
100
57
  }
101
58
 
102
- .select2-container-multi.input-lg .select2-choices .select2-search-field input,
103
- .input-group-lg .select2-container-multi .select2-choices .select2-search-field input {
104
- height: 44px;
59
+ .control-group.info .select2-container .select2-choice,
60
+ .control-group.info .select2-container .select2-choices,
61
+ .control-group.info .select2-container-active .select2-choice,
62
+ .control-group.info .select2-container-active .select2-choices,
63
+ .control-group.info .select2-dropdown-open.select2-drop-above .select2-choice,
64
+ .control-group.info .select2-dropdown-open.select2-drop-above .select2-choices,
65
+ .control-group.info .select2-container-multi.select2-container-active .select2-choices {
66
+ border: 1px solid #3A87AD !important;
105
67
  }
106
68
 
107
- /**
108
- * Adjust height and line-height for .select2-search-field amd multi-select Select2 widgets.
109
- *
110
- * 1. Class repetition to address missing .select2-chosen in Select2 < 3.3.2.
111
- */
112
- .select2-container-multi .select2-choices .select2-search-field input {
113
- margin: 0;
69
+ .control-group.info .select2-container .select2-choice div {
70
+ border-left: 1px solid #3A87AD !important;
71
+ background: #D9EDF7 !important;
114
72
  }
115
73
 
116
- .select2-chosen,
117
- .select2-choice > span:first-child,
118
- .select2-container .select2-choices .select2-search-field input {
119
- padding: 6px 12px;
74
+ .control-group.success .select2-container .select2-choice,
75
+ .control-group.success .select2-container .select2-choices,
76
+ .control-group.success .select2-container-active .select2-choice,
77
+ .control-group.success .select2-container-active .select2-choices,
78
+ .control-group.success .select2-dropdown-open.select2-drop-above .select2-choice,
79
+ .control-group.success .select2-dropdown-open.select2-drop-above .select2-choices,
80
+ .control-group.success .select2-container-multi.select2-container-active .select2-choices {
81
+ border: 1px solid #468847 !important;
120
82
  }
121
83
 
122
- .input-sm .select2-chosen,
123
- .input-group-sm .select2-chosen,
124
- .input-sm .select2-choice > span:first-child,
125
- .input-group-sm .select2-choice > span:first-child,
126
- .input-sm .select2-choices .select2-search-field input,
127
- .input-group-sm .select2-choices .select2-search-field input {
128
- padding: 5px 10px;
129
- }
130
-
131
- .input-lg .select2-chosen,
132
- .input-group-lg .select2-chosen,
133
- .input-lg .select2-choice > span:first-child,
134
- .input-group-lg .select2-choice > span:first-child,
135
- .input-lg .select2-choices .select2-search-field input,
136
- .input-group-lg .select2-choices .select2-search-field input {
137
- padding: 10px 16px;
138
- }
139
-
140
- .select2-container-multi .select2-choices .select2-search-choice {
141
- margin-top: 5px;
142
- margin-bottom: 3px;
143
- }
144
-
145
- .select2-container-multi.input-sm .select2-choices .select2-search-choice,
146
- .input-group-sm .select2-container-multi .select2-choices .select2-search-choice {
147
- margin-top: 3px;
148
- margin-bottom: 2px;
149
- }
150
-
151
- .select2-container-multi.input-lg .select2-choices .select2-search-choice,
152
- .input-group-lg .select2-container-multi .select2-choices .select2-search-choice {
153
- line-height: 24px;
154
- }
155
-
156
- /**
157
- * Adjust the single Select2's dropdown arrow button appearance.
158
- *
159
- * 1. For Select2 v.3.3.2.
160
- */
161
- .select2-container .select2-choice .select2-arrow,
162
- .select2-container .select2-choice div {
163
- border-left: 1px solid #cccccc;
164
- background: none;
165
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
166
- }
167
-
168
- .select2-dropdown-open .select2-choice .select2-arrow,
169
- .select2-dropdown-open .select2-choice div {
170
- border-left-color: transparent;
171
- background: none;
172
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
173
- }
174
-
175
- /**
176
- * Adjust the dropdown arrow button icon position for the single-select Select2 elements
177
- * to make it line up vertically now that we increased the height of .select2-container.
178
- *
179
- * 1. Class repetition to address missing .select2-chosen in Select2 v.3.3.2.
180
- */
181
- .select2-container .select2-choice .select2-arrow b,
182
- .select2-container .select2-choice div b {
183
- background-position: 0 3px;
184
- }
185
-
186
- .select2-dropdown-open .select2-choice .select2-arrow b,
187
- .select2-dropdown-open .select2-choice div b {
188
- background-position: -18px 3px;
189
- }
190
-
191
- .select2-container.input-sm .select2-choice .select2-arrow b,
192
- .input-group-sm .select2-container .select2-choice .select2-arrow b,
193
- .select2-container.input-sm .select2-choice div b,
194
- .input-group-sm .select2-container .select2-choice div b {
195
- background-position: 0 1px;
196
- }
197
-
198
- .select2-dropdown-open.input-sm .select2-choice .select2-arrow b,
199
- .input-group-sm .select2-dropdown-open .select2-choice .select2-arrow b,
200
- .select2-dropdown-open.input-sm .select2-choice div b,
201
- .input-group-sm .select2-dropdown-open .select2-choice div b {
202
- background-position: -18px 1px;
203
- }
204
-
205
- .select2-container.input-lg .select2-choice .select2-arrow b,
206
- .input-group-lg .select2-container .select2-choice .select2-arrow b,
207
- .select2-container.input-lg .select2-choice div b,
208
- .input-group-lg .select2-container .select2-choice div b {
209
- background-position: 0 9px;
210
- }
211
-
212
- .select2-dropdown-open.input-lg .select2-choice .select2-arrow b,
213
- .input-group-lg .select2-dropdown-open .select2-choice .select2-arrow b,
214
- .select2-dropdown-open.input-lg .select2-choice div b,
215
- .input-group-lg .select2-dropdown-open .select2-choice div b {
216
- background-position: -18px 9px;
217
- }
218
-
219
- /**
220
- * Address Bootstrap's validation states and change Select2's border colors and focus states.
221
- * Apply .has-warning, .has-danger or .has-succes to #select2-drop to match Bootstraps' colors.
222
- */
223
- .has-warning .select2-choice,
224
- .has-warning .select2-choices {
225
- border-color: #8a6d3b;
226
- }
227
- .has-warning .select2-container-active .select2-choice,
228
- .has-warning .select2-container-multi.select2-container-active .select2-choices {
229
- border-color: #66512c;
230
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;
231
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;
232
- }
233
- .has-warning.select2-drop-active {
234
- border-color: #66512c;
235
- }
236
- .has-warning.select2-drop-active.select2-drop.select2-drop-above {
237
- border-top-color: #66512c;
238
- }
239
-
240
- .has-error .select2-choice,
241
- .has-error .select2-choices {
242
- border-color: #a94442;
243
- }
244
- .has-error .select2-container-active .select2-choice,
245
- .has-error .select2-container-multi.select2-container-active .select2-choices {
246
- border-color: #843534;
247
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
248
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
249
- }
250
- .has-error.select2-drop-active {
251
- border-color: #843534;
252
- }
253
- .has-error.select2-drop-active.select2-drop.select2-drop-above {
254
- border-top-color: #843534;
255
- }
256
-
257
- .has-success .select2-choice,
258
- .has-success .select2-choices {
259
- border-color: #3c763d;
260
- }
261
- .has-success .select2-container-active .select2-choice,
262
- .has-success .select2-container-multi.select2-container-active .select2-choices {
263
- border-color: #2b542c;
264
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;
265
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;
266
- }
267
- .has-success.select2-drop-active {
268
- border-color: #2b542c;
269
- }
270
- .has-success.select2-drop-active.select2-drop.select2-drop-above {
271
- border-top-color: #2b542c;
272
- }
273
-
274
- /**
275
- * Make Select2's active-styles - applied to .select2-container when the widget receives focus -
276
- * fit Bootstrap 3's .form-element:focus appearance.
277
- */
278
- .select2-container-active .select2-choice,
279
- .select2-container-multi.select2-container-active .select2-choices {
280
- border-color: #66afe9;
281
- outline: none;
282
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
283
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
284
- -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
285
- -o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
286
- transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
287
- }
288
-
289
- .select2-drop-active {
290
- border-color: #66afe9;
291
- }
292
-
293
- .select2-drop-auto-width,
294
- .select2-drop.select2-drop-above.select2-drop-active {
295
- border-top-color: #66afe9;
296
- }
297
-
298
- /**
299
- * Select2 widgets in Bootstrap Input Groups
300
- *
301
- * When Select2 widgets are combined with other elements using Bootstrap 3's
302
- * "Input Group" component, we don't want specific edges of the Select2 container
303
- * to have a border-radius.
304
- *
305
- * In Bootstrap 2, input groups required a markup where these style adjustments
306
- * could be bound to a CSS-class identifying if the additional elements are appended,
307
- * prepended or both.
308
- *
309
- * Bootstrap 3 doesn't rely on these classes anymore, so we have to use our own.
310
- * Use .select2-bootstrap-prepend and .select2-bootstrap-append on a Bootstrap 3 .input-group
311
- * to let the contained Select2 widget know which edges should not be rounded as they are
312
- * directly followed by another element.
313
- *
314
- * @see http://getbootstrap.com/components/#input-groups
315
- */
316
- .input-group.select2-bootstrap-prepend [class^="select2-choice"] {
317
- border-bottom-left-radius: 0 !important;
318
- border-top-left-radius: 0 !important;
319
- }
320
-
321
- .input-group.select2-bootstrap-append [class^="select2-choice"] {
322
- border-bottom-right-radius: 0 !important;
323
- border-top-right-radius: 0 !important;
324
- }
325
-
326
- .select2-dropdown-open [class^="select2-choice"] {
327
- border-bottom-right-radius: 0 !important;
328
- border-bottom-left-radius: 0 !important;
329
- }
330
-
331
- .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
332
- border-top-right-radius: 0 !important;
333
- border-top-left-radius: 0 !important;
334
- border-bottom-right-radius: 4px !important;
335
- border-bottom-left-radius: 4px !important;
336
- }
337
- .input-group.select2-bootstrap-prepend .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
338
- border-bottom-left-radius: 0 !important;
339
- border-top-left-radius: 0 !important;
340
- }
341
- .input-group.select2-bootstrap-append .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
342
- border-bottom-right-radius: 0 !important;
343
- border-top-right-radius: 0 !important;
344
- }
345
- .input-group.input-group-sm.select2-bootstrap-prepend .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
346
- border-bottom-right-radius: 3px !important;
347
- }
348
- .input-group.input-group-lg.select2-bootstrap-prepend .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
349
- border-bottom-right-radius: 6px !important;
350
- }
351
- .input-group.input-group-sm.select2-bootstrap-append .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
352
- border-bottom-left-radius: 3px !important;
353
- }
354
- .input-group.input-group-lg.select2-bootstrap-append .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
355
- border-bottom-left-radius: 6px !important;
356
- }
357
-
358
- /**
359
- * Adjust Select2's choices hover and selected styles to match Bootstrap 3's default dropdown styles.
360
- */
361
- .select2-results .select2-highlighted {
362
- color: white;
363
- background-color: #428bca;
364
- }
365
-
366
- /**
367
- * Adjust alignment of Bootstrap 3 buttons in Bootstrap 3 Input Groups to address
368
- * Multi Select2's height which - depending on how many elements have been selected -
369
- * may grown higher than their initial size.
370
- */
371
- .select2-bootstrap-append .select2-container-multiple,
372
- .select2-bootstrap-append .input-group-btn,
373
- .select2-bootstrap-append .input-group-btn .btn,
374
- .select2-bootstrap-prepend .select2-container-multiple,
375
- .select2-bootstrap-prepend .input-group-btn,
376
- .select2-bootstrap-prepend .input-group-btn .btn {
377
- vertical-align: top;
378
- }
379
-
380
- /**
381
- * Make Multi Select2's choices match Bootstrap 3's default button styles.
382
- */
383
- .select2-container-multi .select2-choices .select2-search-choice {
384
- color: #555555;
385
- background: white;
386
- border-color: #cccccc;
387
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
388
- -webkit-box-shadow: none;
389
- box-shadow: none;
390
- }
391
-
392
- .select2-container-multi .select2-choices .select2-search-choice-focus {
393
- background: #ebebeb;
394
- border-color: #adadad;
395
- color: #333333;
396
- -webkit-box-shadow: none;
397
- box-shadow: none;
398
- }
399
-
400
- /**
401
- * Address Multi Select2's choice close-button vertical alignment.
402
- */
403
- .select2-search-choice-close {
404
- margin-top: -7px;
405
- top: 50%;
406
- }
407
-
408
- /**
409
- * Adjust the single Select2's clear button position (used to reset the select box
410
- * back to the placeholder value and visible once a selection is made
411
- * activated by Select2's "allowClear" option).
412
- */
413
- .select2-container .select2-choice abbr {
414
- top: 50%;
415
- }
416
-
417
- /**
418
- * Adjust "no results" and "selection limit" messages to make use
419
- * of Bootstrap 3's default "Alert" style.
420
- *
421
- * @see http://getbootstrap.com/components/#alerts-default
422
- */
423
- .select2-results .select2-no-results,
424
- .select2-results .select2-searching,
425
- .select2-results .select2-selection-limit {
426
- background-color: #fcf8e3;
427
- color: #8a6d3b;
428
- }
429
-
430
- /**
431
- * Address disabled Select2 styles.
432
- *
433
- * 1. For Select2 v.3.3.2.
434
- * 2. Revert border-left:0 inherited from Select2's CSS to prevent the arrow
435
- * from jumping when switching from disabled to enabled state and vice versa.
436
- */
437
- .select2-container.select2-container-disabled .select2-choice,
438
- .select2-container.select2-container-disabled .select2-choices {
439
- cursor: not-allowed;
440
- background-color: #eeeeee;
441
- border-color: #cccccc;
442
- }
443
- .select2-container.select2-container-disabled .select2-choice .select2-arrow,
444
- .select2-container.select2-container-disabled .select2-choice div,
445
- .select2-container.select2-container-disabled .select2-choices .select2-arrow,
446
- .select2-container.select2-container-disabled .select2-choices div {
447
- background-color: transparent;
448
- border-left: 1px solid transparent;
449
- /* 2 */
450
- }
451
-
452
- /**
453
- * Address Select2's loading indicator position - which should not stick
454
- * to the right edge of Select2's search input.
455
- *
456
- * 1. in .select2-search input
457
- * 2. in Multi Select2's .select2-search-field input
458
- * 3. in the status-message of infinite-scroll with remote data (@see http://ivaynberg.github.io/select2/#infinite)
459
- *
460
- * These styles alter Select2's default background-position of 100%
461
- * and supply the new background-position syntax to browsers which support it:
462
- *
463
- * 1. Android, Safari < 6/Mobile, IE<9: change to a relative background-position of 99%
464
- * 2. Chrome 25+, Firefox 13+, IE 9+, Opera 10.5+: use the new CSS3-background-position syntax
465
- *
466
- * @see http://www.w3.org/TR/css3-background/#background-position
467
- *
468
- * @todo Since both Select2 and Bootstrap 3 only support IE8 and above,
469
- * we could use the :after-pseudo-element to display the loading indicator.
470
- * Alternatively, we could supply an altered loading indicator image which already
471
- * contains an offset to the right.
472
- */
473
- .select2-search input.select2-active,
474
- .select2-container-multi .select2-choices .select2-search-field input.select2-active,
475
- .select2-more-results.select2-active {
476
- background-position: 99%;
477
- /* 4 */
478
- background-position: right 4px center;
479
- /* 5 */
480
- }
481
-
482
- /**
483
- * To support Select2 pre v3.4.2 in combination with Bootstrap v3.2.0,
484
- * ensure that .select2-offscreen width, height and position can not be overwritten.
485
- *
486
- * This adresses changes in Bootstrap somewhere after the initial v3.0.0 which -
487
- * in combination with Select2's pre-v3.4.2 CSS missing the "!important" after
488
- * the following rules - allow Bootstrap to overwrite the latter, which results in
489
- * the original <select> element Select2 is replacing not be properly being hidden
490
- * when used in a "Bootstrap Input Group with Addon".
491
- **/
492
- .select2-offscreen,
493
- .select2-offscreen:focus {
494
- width: 1px !important;
495
- height: 1px !important;
496
- position: absolute !important;
84
+ .control-group.success .select2-container .select2-choice div {
85
+ border-left: 1px solid #468847 !important;
86
+ background: #DFF0D8 !important;
497
87
  }
@@ -1,13 +1,10 @@
1
1
  /*
2
- Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014
2
+ Version: 3.5.4 Timestamp: Sun Aug 30 13:30:32 EDT 2015
3
3
  */
4
4
  .select2-container {
5
5
  margin: 0;
6
6
  position: relative;
7
7
  display: inline-block;
8
- /* inline-block for ie7 */
9
- zoom: 1;
10
- *display: inline;
11
8
  vertical-align: middle;
12
9
  }
13
10
 
@@ -180,10 +177,6 @@ html[dir="rtl"] .select2-container .select2-choice > .select2-chosen {
180
177
  width: auto;
181
178
  }
182
179
 
183
- .select2-drop-auto-width .select2-search {
184
- padding-top: 4px;
185
- }
186
-
187
180
  .select2-container .select2-choice .select2-arrow {
188
181
  display: inline-block;
189
182
  width: 18px;
@@ -230,8 +223,7 @@ html[dir="rtl"] .select2-container .select2-choice .select2-arrow b {
230
223
  width: 100%;
231
224
  min-height: 26px;
232
225
  margin: 0;
233
- padding-left: 4px;
234
- padding-right: 4px;
226
+ padding: 4px 4px 0 4px;
235
227
 
236
228
  position: relative;
237
229
  z-index: 10000;
@@ -273,10 +265,6 @@ html[dir="rtl"] .select2-search input {
273
265
  background: image-url('select2.png') no-repeat -37px -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
274
266
  }
275
267
 
276
- .select2-drop.select2-drop-above .select2-search input {
277
- margin-top: 4px;
278
- }
279
-
280
268
  .select2-search input.select2-active {
281
269
  background: #fff image-url('select2-spinner.gif') no-repeat 100%;
282
270
  background: image-url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
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.5.9.3
4
+ version: 3.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rogerio Medeiros
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-12 00:00:00.000000000 Z
12
+ date: 2016-03-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -158,8 +158,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  version: '0'
159
159
  requirements: []
160
160
  rubyforge_project:
161
- rubygems_version: 2.4.5
161
+ rubygems_version: 2.4.8
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: Integrate Select2 javascript library with Rails asset pipeline
165
165
  test_files: []
166
+ has_rdoc: