Skip to content

Commit 6caddcc

Browse files
committed
Released 0.9.1.
1 parent 59e2004 commit 6caddcc

18 files changed

+157
-56
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "selectize",
33
"keywords": ["select", "ui", "form", "input", "control", "autocomplete", "tagging", "tag"],
44
"description": "Selectize is a jQuery-based custom <select> UI control. Useful for tagging, contact lists, country selectors, etc.",
5-
"version": "0.9.0",
5+
"version": "0.9.1",
66
"license": "Apache License, Version 2.0",
77
"readmeFilename": "README.md",
88
"repository": {

dist/css/selectize.bootstrap2.css

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* selectize.bootstrap2.css (v0.9.0) - Bootstrap 2 Theme
2+
* selectize.bootstrap2.css (v0.9.1) - Bootstrap 2 Theme
33
* Copyright (c) 2013 Brian Reavis & contributors
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
@@ -73,6 +73,8 @@
7373
padding-right: 24px !important;
7474
}
7575
.selectize-control.plugin-remove_button [data-value] .remove {
76+
z-index: 1;
77+
/* fixes ie bug (see #392) */
7678
position: absolute;
7779
top: 0;
7880
right: 0;
@@ -200,6 +202,9 @@
200202
-webkit-box-shadow: none !important;
201203
box-shadow: none !important;
202204
}
205+
.selectize-input > input::-ms-clear {
206+
display: none;
207+
}
203208
.selectize-input > input:focus {
204209
outline: none !important;
205210
}

dist/css/selectize.bootstrap3.css

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* selectize.bootstrap3.css (v0.9.0) - Bootstrap 3 Theme
2+
* selectize.bootstrap3.css (v0.9.1) - Bootstrap 3 Theme
33
* Copyright (c) 2013 Brian Reavis & contributors
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
@@ -73,6 +73,8 @@
7373
padding-right: 24px !important;
7474
}
7575
.selectize-control.plugin-remove_button [data-value] .remove {
76+
z-index: 1;
77+
/* fixes ie bug (see #392) */
7678
position: absolute;
7779
top: 0;
7880
right: 0;
@@ -200,6 +202,9 @@
200202
-webkit-box-shadow: none !important;
201203
box-shadow: none !important;
202204
}
205+
.selectize-input > input::-ms-clear {
206+
display: none;
207+
}
203208
.selectize-input > input:focus {
204209
outline: none !important;
205210
}

dist/css/selectize.css

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* selectize.css (v0.9.0)
2+
* selectize.css (v0.9.1)
33
* Copyright (c) 2013 Brian Reavis & contributors
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
@@ -74,6 +74,8 @@
7474
padding-right: 24px !important;
7575
}
7676
.selectize-control.plugin-remove_button [data-value] .remove {
77+
z-index: 1;
78+
/* fixes ie bug (see #392) */
7779
position: absolute;
7880
top: 0;
7981
right: 0;
@@ -201,6 +203,9 @@
201203
-webkit-box-shadow: none !important;
202204
box-shadow: none !important;
203205
}
206+
.selectize-input > input::-ms-clear {
207+
display: none;
208+
}
204209
.selectize-input > input:focus {
205210
outline: none !important;
206211
}

dist/css/selectize.default.css

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* selectize.default.css (v0.9.0) - Default Theme
2+
* selectize.default.css (v0.9.1) - Default Theme
33
* Copyright (c) 2013 Brian Reavis & contributors
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
@@ -73,6 +73,8 @@
7373
padding-right: 24px !important;
7474
}
7575
.selectize-control.plugin-remove_button [data-value] .remove {
76+
z-index: 1;
77+
/* fixes ie bug (see #392) */
7678
position: absolute;
7779
top: 0;
7880
right: 0;
@@ -200,6 +202,9 @@
200202
-webkit-box-shadow: none !important;
201203
box-shadow: none !important;
202204
}
205+
.selectize-input > input::-ms-clear {
206+
display: none;
207+
}
203208
.selectize-input > input:focus {
204209
outline: none !important;
205210
}

dist/css/selectize.legacy.css

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* selectize.legacy.css (v0.9.0) - Default Theme
2+
* selectize.legacy.css (v0.9.1) - Default Theme
33
* Copyright (c) 2013 Brian Reavis & contributors
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
@@ -73,6 +73,8 @@
7373
padding-right: 24px !important;
7474
}
7575
.selectize-control.plugin-remove_button [data-value] .remove {
76+
z-index: 1;
77+
/* fixes ie bug (see #392) */
7678
position: absolute;
7779
top: 0;
7880
right: 0;
@@ -200,6 +202,9 @@
200202
-webkit-box-shadow: none !important;
201203
box-shadow: none !important;
202204
}
205+
.selectize-input > input::-ms-clear {
206+
display: none;
207+
}
203208
.selectize-input > input:focus {
204209
outline: none !important;
205210
}

dist/js/selectize.js

+55-19
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* selectize.js (v0.9.0)
2+
* selectize.js (v0.9.1)
33
* Copyright (c) 2013 Brian Reavis & contributors
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
@@ -371,7 +371,7 @@
371371
if (!str) {
372372
return 0;
373373
}
374-
374+
375375
var $test = $('<test>').css({
376376
position: 'absolute',
377377
top: -99999,
@@ -406,14 +406,15 @@
406406
*/
407407
var autoGrow = function($input) {
408408
var currentWidth = null;
409-
410-
var update = function(e) {
409+
410+
var update = function(e, options) {
411411
var value, keyCode, printable, placeholder, width;
412412
var shift, character, selection;
413413
e = e || window.event || {};
414+
options = options || {};
414415

415416
if (e.metaKey || e.altKey) return;
416-
if ($input.data('grow') === false) return;
417+
if (!options.force && $input.data('grow') === false) return;
417418

418419
value = $input.val();
419420
if (e.type && e.type.toLowerCase() === 'keydown') {
@@ -443,8 +444,8 @@
443444
}
444445
}
445446

446-
placeholder = $input.attr('placeholder') || '';
447-
if (!value.length && placeholder.length) {
447+
placeholder = $input.attr('placeholder');
448+
if (!value && placeholder) {
448449
value = placeholder;
449450
}
450451

@@ -506,7 +507,7 @@
506507
userOptions : {},
507508
items : [],
508509
renderCache : {},
509-
onSearchChange : debounce(self.onSearchChange, settings.loadThrottle)
510+
onSearchChange : settings.loadThrottle === null ? self.onSearchChange : debounce(self.onSearchChange, settings.loadThrottle)
510511
});
511512

512513
// search system
@@ -595,6 +596,14 @@
595596
$control_input.attr('placeholder', settings.placeholder);
596597
}
597598

599+
if (self.$input.attr('autocorrect')) {
600+
$control_input.attr('autocorrect', self.$input.attr('autocorrect'));
601+
}
602+
603+
if (self.$input.attr('autocapitalize')) {
604+
$control_input.attr('autocapitalize', self.$input.attr('autocapitalize'));
605+
}
606+
598607
self.$wrapper = $wrapper;
599608
self.$control = $control;
600609
self.$control_input = $control_input;
@@ -618,7 +627,8 @@
618627
keypress : function() { return self.onKeyPress.apply(self, arguments); },
619628
resize : function() { self.positionDropdown.apply(self, []); },
620629
blur : function() { return self.onBlur.apply(self, arguments); },
621-
focus : function() { return self.onFocus.apply(self, arguments); }
630+
focus : function() { return self.onFocus.apply(self, arguments); },
631+
paste : function() { return self.onPaste.apply(self, arguments); }
622632
});
623633

624634
$document.on('keydown' + eventNS, function(e) {
@@ -815,6 +825,20 @@
815825
this.$input.trigger('change');
816826
},
817827

828+
829+
/**
830+
* Triggered on <input> paste.
831+
*
832+
* @param {object} e
833+
* @returns {boolean}
834+
*/
835+
onPaste: function(e) {
836+
var self = this;
837+
if (self.isFull() || self.isInputHidden || self.isLocked) {
838+
e.preventDefault();
839+
}
840+
},
841+
818842
/**
819843
* Triggered on <input> keypress.
820844
*
@@ -859,7 +883,7 @@
859883
self.close();
860884
return;
861885
case KEY_N:
862-
if (!e.ctrlKey) break;
886+
if (!e.ctrlKey || e.altKey) break;
863887
case KEY_DOWN:
864888
if (!self.isOpen && self.hasOptions) {
865889
self.open();
@@ -871,7 +895,7 @@
871895
e.preventDefault();
872896
return;
873897
case KEY_P:
874-
if (!e.ctrlKey) break;
898+
if (!e.ctrlKey || e.altKey) break;
875899
case KEY_UP:
876900
if (self.$activeOption) {
877901
self.ignoreHover = true;
@@ -893,7 +917,7 @@
893917
self.advanceSelection(1, e);
894918
return;
895919
case KEY_TAB:
896-
if (self.isOpen && self.$activeOption) {
920+
if (self.settings.selectOnTab && self.isOpen && self.$activeOption) {
897921
self.onOptionSelect({currentTarget: self.$activeOption});
898922
}
899923
if (self.settings.create && self.createItem()) {
@@ -905,7 +929,8 @@
905929
self.deleteSelection(e);
906930
return;
907931
}
908-
if (self.isFull() || self.isInputHidden) {
932+
933+
if ((self.isFull() || self.isInputHidden) && !(IS_MAC ? e.metaKey : e.ctrlKey)) {
909934
e.preventDefault();
910935
return;
911936
}
@@ -1091,8 +1116,12 @@
10911116
* @param {string} value
10921117
*/
10931118
setTextboxValue: function(value) {
1094-
this.$control_input.val(value).triggerHandler('update');
1095-
this.lastValue = value;
1119+
var $input = this.$control_input;
1120+
var changed = $input.val() !== value;
1121+
if (changed) {
1122+
$input.val(value).triggerHandler('update');
1123+
this.lastValue = value;
1124+
}
10961125
},
10971126

10981127
/**
@@ -1573,11 +1602,11 @@
15731602
cache_items = self.renderCache['item'];
15741603
cache_options = self.renderCache['option'];
15751604

1576-
if (isset(cache_items)) {
1605+
if (cache_items) {
15771606
delete cache_items[value];
15781607
delete cache_items[value_new];
15791608
}
1580-
if (isset(cache_options)) {
1609+
if (cache_options) {
15811610
delete cache_options[value];
15821611
delete cache_options[value_new];
15831612
}
@@ -1603,8 +1632,13 @@
16031632
*/
16041633
removeOption: function(value) {
16051634
var self = this;
1606-
16071635
value = hash_key(value);
1636+
1637+
var cache_items = self.renderCache['item'];
1638+
var cache_options = self.renderCache['option'];
1639+
if (cache_items) delete cache_items[value];
1640+
if (cache_options) delete cache_options[value];
1641+
16081642
delete self.userOptions[value];
16091643
delete self.options[value];
16101644
self.lastQuery = null;
@@ -1620,6 +1654,7 @@
16201654

16211655
self.loadedSearches = {};
16221656
self.userOptions = {};
1657+
self.renderCache = {};
16231658
self.options = self.sifter.items = {};
16241659
self.lastQuery = null;
16251660
self.trigger('option_clear');
@@ -1945,7 +1980,7 @@
19451980
} else {
19461981
$input.attr('placeholder', this.settings.placeholder);
19471982
}
1948-
$input.triggerHandler('update');
1983+
$input.triggerHandler('update', {force: true});
19491984
},
19501985

19511986
/**
@@ -2335,6 +2370,7 @@
23352370
maxItems: null,
23362371
hideSelected: null,
23372372
addPrecedence: false,
2373+
selectOnTab: false,
23382374
preload: false,
23392375

23402376
scrollDuration: 60,

dist/js/selectize.min.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)