selectize-rails 0.9.0 → 0.9.1

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: 6084efa3505aee7491d92ddc9257dad81af35c98
4
- data.tar.gz: d25b3273492258005777c08e92c924898abca061
3
+ metadata.gz: 5e7aa8c5a1c167b3467f16744bd3b26da58c6432
4
+ data.tar.gz: 773fbbbe7af8267cecc48926f1b9232196604f73
5
5
  SHA512:
6
- metadata.gz: 4a6ac0856376192c34f3032f86fddcd8c56cf7a84398c7d419571b7db03deb83cb419440fa23d5779ee019c3542144374d1414e62fb84499c3775276f3d727a4
7
- data.tar.gz: db5015e446beadf99e036bb52ef2cf5bd911daac0238c3538cb3a65a6ecd1b52231641efad0a3fd916c6aa54ce2873d6b18f184b444f9c17b8cf27c1744f5355
6
+ metadata.gz: 2de553cfa35683eff97409b20835b1baf592ab75771942f4dd27d9cae3b5840a930c4562d23ff62af4824cd494d5e010adf08ccebd7217acfb522d44bd3bdc30
7
+ data.tar.gz: 6e1001c11401ade160dd62fcb19b81603110b6c41ad305996261f2e56ded79dcfa4156698c1e0fe1674224863fdf202feee9f3fd5398429f960413be7c7b5bf9
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.0.0
1
+ 2.1.1
data/CHANGELOG.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  | Version | Notes |
4
4
  | -------:| ----------------------------------------------------------- |
5
+ | 0.9.1 | Update to v0.9.1 of selectize.js |
5
6
  | 0.9.0 | Update to v0.9.0 of selectize.js |
6
7
  | 0.8.5 | Update to v0.8.5 of selectize.js |
7
8
  | 0.8.4 | Update to v0.8.4 of selectize.js |
data/README.md CHANGED
@@ -41,11 +41,11 @@ See the [demo page of Brian Reavis](http://brianreavis.github.io/selectize.js/)
41
41
 
42
42
  | Version | Notes |
43
43
  | -------:| ----------------------------------------------------------- |
44
+ | 0.9.1 | Update to v0.9.1 of selectize.js |
44
45
  | 0.9.0 | Update to v0.9.0 of selectize.js |
45
46
  | 0.8.5 | Update to v0.8.5 of selectize.js |
46
47
  | 0.8.4 | Update to v0.8.4 of selectize.js |
47
48
  | 0.8.3 | Update to v0.8.3 of selectize.js |
48
- | 0.8.1 | Update to v0.8.1 of selectize.js |
49
49
 
50
50
  [older](CHANGELOG.md)
51
51
 
@@ -1,5 +1,5 @@
1
1
  module Selectize
2
2
  module Rails
3
- VERSION = "0.9.0"
3
+ VERSION = "0.9.1"
4
4
  end
5
5
  end
@@ -585,7 +585,7 @@
585
585
  }));
586
586
 
587
587
  /**
588
- * selectize.js (v0.9.0)
588
+ * selectize.js (v0.9.1)
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
@@ -957,7 +957,7 @@
957
957
  if (!str) {
958
958
  return 0;
959
959
  }
960
-
960
+
961
961
  var $test = $('<test>').css({
962
962
  position: 'absolute',
963
963
  top: -99999,
@@ -992,14 +992,15 @@
992
992
  */
993
993
  var autoGrow = function($input) {
994
994
  var currentWidth = null;
995
-
996
- var update = function(e) {
995
+
996
+ var update = function(e, options) {
997
997
  var value, keyCode, printable, placeholder, width;
998
998
  var shift, character, selection;
999
999
  e = e || window.event || {};
1000
+ options = options || {};
1000
1001
 
1001
1002
  if (e.metaKey || e.altKey) return;
1002
- if ($input.data('grow') === false) return;
1003
+ if (!options.force && $input.data('grow') === false) return;
1003
1004
 
1004
1005
  value = $input.val();
1005
1006
  if (e.type && e.type.toLowerCase() === 'keydown') {
@@ -1029,8 +1030,8 @@
1029
1030
  }
1030
1031
  }
1031
1032
 
1032
- placeholder = $input.attr('placeholder') || '';
1033
- if (!value.length && placeholder.length) {
1033
+ placeholder = $input.attr('placeholder');
1034
+ if (!value && placeholder) {
1034
1035
  value = placeholder;
1035
1036
  }
1036
1037
 
@@ -1092,7 +1093,7 @@
1092
1093
  userOptions : {},
1093
1094
  items : [],
1094
1095
  renderCache : {},
1095
- onSearchChange : debounce(self.onSearchChange, settings.loadThrottle)
1096
+ onSearchChange : settings.loadThrottle === null ? self.onSearchChange : debounce(self.onSearchChange, settings.loadThrottle)
1096
1097
  });
1097
1098
 
1098
1099
  // search system
@@ -1181,6 +1182,14 @@
1181
1182
  $control_input.attr('placeholder', settings.placeholder);
1182
1183
  }
1183
1184
 
1185
+ if (self.$input.attr('autocorrect')) {
1186
+ $control_input.attr('autocorrect', self.$input.attr('autocorrect'));
1187
+ }
1188
+
1189
+ if (self.$input.attr('autocapitalize')) {
1190
+ $control_input.attr('autocapitalize', self.$input.attr('autocapitalize'));
1191
+ }
1192
+
1184
1193
  self.$wrapper = $wrapper;
1185
1194
  self.$control = $control;
1186
1195
  self.$control_input = $control_input;
@@ -1204,7 +1213,8 @@
1204
1213
  keypress : function() { return self.onKeyPress.apply(self, arguments); },
1205
1214
  resize : function() { self.positionDropdown.apply(self, []); },
1206
1215
  blur : function() { return self.onBlur.apply(self, arguments); },
1207
- focus : function() { return self.onFocus.apply(self, arguments); }
1216
+ focus : function() { return self.onFocus.apply(self, arguments); },
1217
+ paste : function() { return self.onPaste.apply(self, arguments); }
1208
1218
  });
1209
1219
 
1210
1220
  $document.on('keydown' + eventNS, function(e) {
@@ -1401,6 +1411,20 @@
1401
1411
  this.$input.trigger('change');
1402
1412
  },
1403
1413
 
1414
+
1415
+ /**
1416
+ * Triggered on <input> paste.
1417
+ *
1418
+ * @param {object} e
1419
+ * @returns {boolean}
1420
+ */
1421
+ onPaste: function(e) {
1422
+ var self = this;
1423
+ if (self.isFull() || self.isInputHidden || self.isLocked) {
1424
+ e.preventDefault();
1425
+ }
1426
+ },
1427
+
1404
1428
  /**
1405
1429
  * Triggered on <input> keypress.
1406
1430
  *
@@ -1445,7 +1469,7 @@
1445
1469
  self.close();
1446
1470
  return;
1447
1471
  case KEY_N:
1448
- if (!e.ctrlKey) break;
1472
+ if (!e.ctrlKey || e.altKey) break;
1449
1473
  case KEY_DOWN:
1450
1474
  if (!self.isOpen && self.hasOptions) {
1451
1475
  self.open();
@@ -1457,7 +1481,7 @@
1457
1481
  e.preventDefault();
1458
1482
  return;
1459
1483
  case KEY_P:
1460
- if (!e.ctrlKey) break;
1484
+ if (!e.ctrlKey || e.altKey) break;
1461
1485
  case KEY_UP:
1462
1486
  if (self.$activeOption) {
1463
1487
  self.ignoreHover = true;
@@ -1479,7 +1503,7 @@
1479
1503
  self.advanceSelection(1, e);
1480
1504
  return;
1481
1505
  case KEY_TAB:
1482
- if (self.isOpen && self.$activeOption) {
1506
+ if (self.settings.selectOnTab && self.isOpen && self.$activeOption) {
1483
1507
  self.onOptionSelect({currentTarget: self.$activeOption});
1484
1508
  }
1485
1509
  if (self.settings.create && self.createItem()) {
@@ -1491,7 +1515,8 @@
1491
1515
  self.deleteSelection(e);
1492
1516
  return;
1493
1517
  }
1494
- if (self.isFull() || self.isInputHidden) {
1518
+
1519
+ if ((self.isFull() || self.isInputHidden) && !(IS_MAC ? e.metaKey : e.ctrlKey)) {
1495
1520
  e.preventDefault();
1496
1521
  return;
1497
1522
  }
@@ -1677,8 +1702,12 @@
1677
1702
  * @param {string} value
1678
1703
  */
1679
1704
  setTextboxValue: function(value) {
1680
- this.$control_input.val(value).triggerHandler('update');
1681
- this.lastValue = value;
1705
+ var $input = this.$control_input;
1706
+ var changed = $input.val() !== value;
1707
+ if (changed) {
1708
+ $input.val(value).triggerHandler('update');
1709
+ this.lastValue = value;
1710
+ }
1682
1711
  },
1683
1712
 
1684
1713
  /**
@@ -2159,11 +2188,11 @@
2159
2188
  cache_items = self.renderCache['item'];
2160
2189
  cache_options = self.renderCache['option'];
2161
2190
 
2162
- if (isset(cache_items)) {
2191
+ if (cache_items) {
2163
2192
  delete cache_items[value];
2164
2193
  delete cache_items[value_new];
2165
2194
  }
2166
- if (isset(cache_options)) {
2195
+ if (cache_options) {
2167
2196
  delete cache_options[value];
2168
2197
  delete cache_options[value_new];
2169
2198
  }
@@ -2189,8 +2218,13 @@
2189
2218
  */
2190
2219
  removeOption: function(value) {
2191
2220
  var self = this;
2192
-
2193
2221
  value = hash_key(value);
2222
+
2223
+ var cache_items = self.renderCache['item'];
2224
+ var cache_options = self.renderCache['option'];
2225
+ if (cache_items) delete cache_items[value];
2226
+ if (cache_options) delete cache_options[value];
2227
+
2194
2228
  delete self.userOptions[value];
2195
2229
  delete self.options[value];
2196
2230
  self.lastQuery = null;
@@ -2206,6 +2240,7 @@
2206
2240
 
2207
2241
  self.loadedSearches = {};
2208
2242
  self.userOptions = {};
2243
+ self.renderCache = {};
2209
2244
  self.options = self.sifter.items = {};
2210
2245
  self.lastQuery = null;
2211
2246
  self.trigger('option_clear');
@@ -2531,7 +2566,7 @@
2531
2566
  } else {
2532
2567
  $input.attr('placeholder', this.settings.placeholder);
2533
2568
  }
2534
- $input.triggerHandler('update');
2569
+ $input.triggerHandler('update', {force: true});
2535
2570
  },
2536
2571
 
2537
2572
  /**
@@ -2921,6 +2956,7 @@
2921
2956
  maxItems: null,
2922
2957
  hideSelected: null,
2923
2958
  addPrecedence: false,
2959
+ selectOnTab: false,
2924
2960
  preload: false,
2925
2961
 
2926
2962
  scrollDuration: 60,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * selectize.bootstrap2.css (v0.9.0) - Bootstrap 2 Theme
2
+ * selectize.bootstrap2.css (v0.9.1) - 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
@@ -73,6 +73,8 @@
73
73
  padding-right: 24px !important;
74
74
  }
75
75
  .selectize-control.plugin-remove_button [data-value] .remove {
76
+ z-index: 1;
77
+ /* fixes ie bug (see #392) */
76
78
  position: absolute;
77
79
  top: 0;
78
80
  right: 0;
@@ -200,6 +202,9 @@
200
202
  -webkit-box-shadow: none !important;
201
203
  box-shadow: none !important;
202
204
  }
205
+ .selectize-input > input::-ms-clear {
206
+ display: none;
207
+ }
203
208
  .selectize-input > input:focus {
204
209
  outline: none !important;
205
210
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * selectize.bootstrap3.css (v0.9.0) - Bootstrap 3 Theme
2
+ * selectize.bootstrap3.css (v0.9.1) - 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
@@ -73,6 +73,8 @@
73
73
  padding-right: 24px !important;
74
74
  }
75
75
  .selectize-control.plugin-remove_button [data-value] .remove {
76
+ z-index: 1;
77
+ /* fixes ie bug (see #392) */
76
78
  position: absolute;
77
79
  top: 0;
78
80
  right: 0;
@@ -200,6 +202,9 @@
200
202
  -webkit-box-shadow: none !important;
201
203
  box-shadow: none !important;
202
204
  }
205
+ .selectize-input > input::-ms-clear {
206
+ display: none;
207
+ }
203
208
  .selectize-input > input:focus {
204
209
  outline: none !important;
205
210
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * selectize.css (v0.9.0)
2
+ * selectize.css (v0.9.1)
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
@@ -74,6 +74,8 @@
74
74
  padding-right: 24px !important;
75
75
  }
76
76
  .selectize-control.plugin-remove_button [data-value] .remove {
77
+ z-index: 1;
78
+ /* fixes ie bug (see #392) */
77
79
  position: absolute;
78
80
  top: 0;
79
81
  right: 0;
@@ -201,6 +203,9 @@
201
203
  -webkit-box-shadow: none !important;
202
204
  box-shadow: none !important;
203
205
  }
206
+ .selectize-input > input::-ms-clear {
207
+ display: none;
208
+ }
204
209
  .selectize-input > input:focus {
205
210
  outline: none !important;
206
211
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * selectize.default.css (v0.9.0) - Default Theme
2
+ * selectize.default.css (v0.9.1) - 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
@@ -73,6 +73,8 @@
73
73
  padding-right: 24px !important;
74
74
  }
75
75
  .selectize-control.plugin-remove_button [data-value] .remove {
76
+ z-index: 1;
77
+ /* fixes ie bug (see #392) */
76
78
  position: absolute;
77
79
  top: 0;
78
80
  right: 0;
@@ -200,6 +202,9 @@
200
202
  -webkit-box-shadow: none !important;
201
203
  box-shadow: none !important;
202
204
  }
205
+ .selectize-input > input::-ms-clear {
206
+ display: none;
207
+ }
203
208
  .selectize-input > input:focus {
204
209
  outline: none !important;
205
210
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * selectize.legacy.css (v0.9.0) - Default Theme
2
+ * selectize.legacy.css (v0.9.1) - 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
@@ -73,6 +73,8 @@
73
73
  padding-right: 24px !important;
74
74
  }
75
75
  .selectize-control.plugin-remove_button [data-value] .remove {
76
+ z-index: 1;
77
+ /* fixes ie bug (see #392) */
76
78
  position: absolute;
77
79
  top: 0;
78
80
  right: 0;
@@ -200,6 +202,9 @@
200
202
  -webkit-box-shadow: none !important;
201
203
  box-shadow: none !important;
202
204
  }
205
+ .selectize-input > input::-ms-clear {
206
+ display: none;
207
+ }
203
208
  .selectize-input > input:focus {
204
209
  outline: none !important;
205
210
  }
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selectize-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
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-03-26 00:00:00.000000000 Z
11
+ date: 2014-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: A small gem for putting selectize.js into the Rails asset pipeline
@@ -45,9 +45,9 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - .gitignore
49
- - .ruby-gemset
50
- - .ruby-version
48
+ - ".gitignore"
49
+ - ".ruby-gemset"
50
+ - ".ruby-version"
51
51
  - CHANGELOG.md
52
52
  - Gemfile
53
53
  - LICENSE.txt
@@ -75,17 +75,17 @@ require_paths:
75
75
  - lib
76
76
  required_ruby_version: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - '>='
78
+ - - ">="
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - '>='
83
+ - - ">="
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  requirements: []
87
87
  rubyforge_project:
88
- rubygems_version: 2.1.11
88
+ rubygems_version: 2.2.2
89
89
  signing_key:
90
90
  specification_version: 4
91
91
  summary: an asset gemification of the selectize.js plugin