selectize-rails 0.11.0 → 0.11.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ddd296151375e4a6ec7c3bd1a15ff5139adc4b2
4
- data.tar.gz: 6578eedb181b964165c7e82950efe047fd156696
3
+ metadata.gz: 26f3a8fd457c292f06dd6c884fb5bcb2af9d5b29
4
+ data.tar.gz: de3dfed0605769a8a1bd71744da6032467409d4a
5
5
  SHA512:
6
- metadata.gz: ccd238e0ffafe86c93f61860422edc40b2c29a177bca90737367f36d01f46a0737ed77dffc712ca98895c1039090f1a8b479ce7ba7f0d89f3860b53cd6357fd5
7
- data.tar.gz: ad7b5c389063444e32f97f0304f9580625c6cdc191bb2f065bc2313048cad2106bbd79c0dfe76516f75f2a66bf9dafd5580c2c312a6e20370f37ec12ac52564b
6
+ metadata.gz: 579e9599ddb096767dadfd1ff28b0d3f48bc6f2c320576c58e38ae8fc71ab85a6b97f7328d2f4c3cfcbbf05c2f674cd56fb5ab141c30814a020dbead6490dccf
7
+ data.tar.gz: a2207537b323baaa3eac720061e65a0e17807ef0620e6c2358902a81b98b94eb504c9a35aacd38556885f11300f3628e171beb8faf4f438726b2bf972a1b0392
data/CHANGELOG.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  | Version | Notes |
4
4
  | --------:| ----------------------------------------------------------- |
5
+ | 0.11.2 | Update to v0.11.2 of selectize.js |
5
6
  | 0.11.0 | Update to v0.11.0 of selectize.js |
6
7
  | 0.9.1 | Update to v0.9.1 of selectize.js |
7
8
  | 0.9.0 | Update to v0.9.0 of selectize.js |
data/README.md CHANGED
@@ -41,6 +41,7 @@ See the [demo page of Brian Reavis](http://brianreavis.github.io/selectize.js/)
41
41
 
42
42
  | Version | Notes |
43
43
  | --------:| ----------------------------------------------------------- |
44
+ | 0.11.2 | Update to v0.11.2 of selectize.js |
44
45
  | 0.11.0 | Update to v0.11.0 of selectize.js |
45
46
  | 0.9.1 | Update to v0.9.1 of selectize.js |
46
47
  | 0.9.0 | Update to v0.9.0 of selectize.js |
@@ -1,5 +1,5 @@
1
1
  module Selectize
2
2
  module Rails
3
- VERSION = "0.11.0"
3
+ VERSION = "0.11.2"
4
4
  end
5
5
  end
@@ -12,6 +12,6 @@ cp tmp_vendor/dist/css/*.css vendor/assets/stylesheets/
12
12
 
13
13
  # Delete vendor repo
14
14
  echo "Removing cloned vendor repo"
15
- # rm -rf tmp_vendor
15
+ rm -rf tmp_vendor
16
16
 
17
17
  echo "Finished... You'll need to commit the changes. You should consider updating the changelog and gem version number"
@@ -585,7 +585,7 @@
585
585
  }));
586
586
 
587
587
  /**
588
- * selectize.js (v0.11.0)
588
+ * selectize.js (v0.11.2)
589
589
  * Copyright (c) 2013 Brian Reavis & contributors
590
590
  *
591
591
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
@@ -1053,7 +1053,8 @@
1053
1053
  input.selectize = self;
1054
1054
 
1055
1055
  // detect rtl environment
1056
- dir = window.getComputedStyle ? window.getComputedStyle(input, null).getPropertyValue('direction') : input.currentStyle && input.currentStyle.direction;
1056
+ var computedStyle = window.getComputedStyle && window.getComputedStyle(input, null);
1057
+ dir = computedStyle ? computedStyle.getPropertyValue('direction') : input.currentStyle && input.currentStyle.direction;
1057
1058
  dir = dir || $input.parents('[dir]:first').attr('dir') || '';
1058
1059
 
1059
1060
  // setup default state
@@ -1114,16 +1115,6 @@
1114
1115
  self.settings.hideSelected = self.settings.mode === 'multi';
1115
1116
  }
1116
1117
 
1117
- if (self.settings.create) {
1118
- self.canCreate = function(input) {
1119
- var filter = self.settings.createFilter;
1120
- return input.length
1121
- && (typeof filter !== 'function' || filter.apply(self, [input]))
1122
- && (typeof filter !== 'string' || new RegExp(filter).test(input))
1123
- && (!(filter instanceof RegExp) || filter.test(input));
1124
- };
1125
- }
1126
-
1127
1118
  self.initializePlugins(self.settings.plugins);
1128
1119
  self.setupCallbacks();
1129
1120
  self.setupTemplates();
@@ -1173,9 +1164,13 @@
1173
1164
  $control = $('<div>').addClass(settings.inputClass).addClass('items').appendTo($wrapper);
1174
1165
  $control_input = $('<input type="text" autocomplete="off" />').appendTo($control).attr('tabindex', tab_index);
1175
1166
  $dropdown_parent = $(settings.dropdownParent || $wrapper);
1176
- $dropdown = $('<div>').addClass(settings.dropdownClass).addClass(classes).addClass(inputMode).hide().appendTo($dropdown_parent);
1167
+ $dropdown = $('<div>').addClass(settings.dropdownClass).addClass(inputMode).hide().appendTo($dropdown_parent);
1177
1168
  $dropdown_content = $('<div>').addClass(settings.dropdownContentClass).appendTo($dropdown);
1178
1169
 
1170
+ if(self.settings.copyClassesToDropdown) {
1171
+ $dropdown.addClass(classes);
1172
+ }
1173
+
1179
1174
  $wrapper.css({
1180
1175
  width: $input[0].style.width
1181
1176
  });
@@ -1354,7 +1349,8 @@
1354
1349
  'option_clear' : 'onOptionClear',
1355
1350
  'dropdown_open' : 'onDropdownOpen',
1356
1351
  'dropdown_close' : 'onDropdownClose',
1357
- 'type' : 'onType'
1352
+ 'type' : 'onType',
1353
+ 'load' : 'onLoad'
1358
1354
  };
1359
1355
 
1360
1356
  for (key in callbacks) {
@@ -2026,7 +2022,7 @@
2026
2022
  }
2027
2023
 
2028
2024
  var self = this;
2029
- var query = self.$control_input.val();
2025
+ var query = $.trim(self.$control_input.val());
2030
2026
  var results = self.search(query);
2031
2027
  var $dropdown_content = self.$dropdown_content;
2032
2028
  var active_before = self.$activeOption && hash_key(self.$activeOption.attr('data-value'));
@@ -2102,7 +2098,7 @@
2102
2098
  }
2103
2099
 
2104
2100
  // add create option
2105
- has_create_option = self.settings.create && self.canCreate(results.query);
2101
+ has_create_option = self.canCreate(query);
2106
2102
  if (has_create_option) {
2107
2103
  $dropdown_content.prepend(self.render('option_create', {input: query}));
2108
2104
  $create = $($dropdown_content[0].childNodes[0]);
@@ -2231,6 +2227,9 @@
2231
2227
  $item.replaceWith($item_new);
2232
2228
  }
2233
2229
 
2230
+ //invalidate last query because we might have updated the sortField
2231
+ self.lastQuery = null;
2232
+
2234
2233
  // update dropdown contents
2235
2234
  if (self.isOpen) {
2236
2235
  self.refreshOptions(false);
@@ -2992,8 +2991,24 @@
2992
2991
  } else {
2993
2992
  delete self.renderCache[templateName];
2994
2993
  }
2995
- }
2994
+ },
2996
2995
 
2996
+ /**
2997
+ * Determines whether or not to display the
2998
+ * create item prompt, given a user input.
2999
+ *
3000
+ * @param {string} input
3001
+ * @return {boolean}
3002
+ */
3003
+ canCreate: function(input) {
3004
+ var self = this;
3005
+ if (!self.settings.create) return false;
3006
+ var filter = self.settings.createFilter;
3007
+ return input.length
3008
+ && (typeof filter !== 'function' || filter.apply(self, [input]))
3009
+ && (typeof filter !== 'string' || new RegExp(filter).test(input))
3010
+ && (!(filter instanceof RegExp) || filter.test(input));
3011
+ }
2997
3012
 
2998
3013
  });
2999
3014
 
@@ -3040,6 +3055,8 @@
3040
3055
 
3041
3056
  dropdownParent: null,
3042
3057
 
3058
+ copyClassesToDropdown: true,
3059
+
3043
3060
  /*
3044
3061
  load : null, // function(query, callback) { ... }
3045
3062
  score : null, // function(search) { ... }
@@ -3068,6 +3085,7 @@
3068
3085
  }
3069
3086
  };
3070
3087
 
3088
+
3071
3089
  $.fn.selectize = function(settings_user) {
3072
3090
  var defaults = $.fn.selectize.defaults;
3073
3091
  var settings = $.extend({}, defaults, settings_user);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * selectize.bootstrap2.css (v0.11.0) - Bootstrap 2 Theme
2
+ * selectize.bootstrap2.css (v0.11.2) - Bootstrap 2 Theme
3
3
  * Copyright (c) 2013 Brian Reavis & contributors
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
@@ -189,6 +189,7 @@
189
189
  border: 1px solid #e0e0e0;
190
190
  }
191
191
  .selectize-input > input {
192
+ display: inline-block !important;
192
193
  padding: 0 !important;
193
194
  min-height: 0 !important;
194
195
  max-height: none !important;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * selectize.bootstrap3.css (v0.11.0) - Bootstrap 3 Theme
2
+ * selectize.bootstrap3.css (v0.11.2) - Bootstrap 3 Theme
3
3
  * Copyright (c) 2013 Brian Reavis & contributors
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
@@ -189,6 +189,7 @@
189
189
  border: 0 solid rgba(77, 77, 77, 0);
190
190
  }
191
191
  .selectize-input > input {
192
+ display: inline-block !important;
192
193
  padding: 0 !important;
193
194
  min-height: 0 !important;
194
195
  max-height: none !important;
@@ -368,6 +369,16 @@
368
369
  -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
369
370
  box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
370
371
  }
372
+ .has-error .selectize-input {
373
+ border-color: #a94442;
374
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
375
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
376
+ }
377
+ .has-error .selectize-input:focus {
378
+ border-color: #843534;
379
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
380
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
381
+ }
371
382
  .selectize-control.multi .selectize-input.has-items {
372
383
  padding-left: 9px;
373
384
  padding-right: 9px;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * selectize.css (v0.11.0)
2
+ * selectize.css (v0.11.2)
3
3
  * Copyright (c) 2013 Brian Reavis & contributors
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
@@ -190,6 +190,7 @@
190
190
  border: 0 solid #ffffff;
191
191
  }
192
192
  .selectize-input > input {
193
+ display: inline-block !important;
193
194
  padding: 0 !important;
194
195
  min-height: 0 !important;
195
196
  max-height: none !important;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * selectize.default.css (v0.11.0) - Default Theme
2
+ * selectize.default.css (v0.11.2) - Default Theme
3
3
  * Copyright (c) 2013 Brian Reavis & contributors
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
@@ -189,6 +189,7 @@
189
189
  border: 1px solid #aaaaaa;
190
190
  }
191
191
  .selectize-input > input {
192
+ display: inline-block !important;
192
193
  padding: 0 !important;
193
194
  min-height: 0 !important;
194
195
  max-height: none !important;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * selectize.legacy.css (v0.11.0) - Default Theme
2
+ * selectize.legacy.css (v0.11.2) - Default Theme
3
3
  * Copyright (c) 2013 Brian Reavis & contributors
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
@@ -189,6 +189,7 @@
189
189
  border: 1px solid #b4b4b4;
190
190
  }
191
191
  .selectize-input > input {
192
+ display: inline-block !important;
192
193
  padding: 0 !important;
193
194
  min-height: 0 !important;
194
195
  max-height: none !important;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selectize-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel van Rijn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-22 00:00:00.000000000 Z
11
+ date: 2014-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler