Skip to content

Commit 20da6e5

Browse files
committed
Released 0.11.1.
1 parent bd95ccf commit 20da6e5

17 files changed

+121
-53
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
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.11.0",
5+
"version": "0.11.1",
66
"license": "Apache License, Version 2.0",
77
"readmeFilename": "README.md",
88
"repository": {

dist/css/selectize.bootstrap2.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* selectize.bootstrap2.css (v0.11.0) - Bootstrap 2 Theme
2+
* selectize.bootstrap2.css (v0.11.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
@@ -189,6 +189,7 @@
189189
border: 1px solid #e0e0e0;
190190
}
191191
.selectize-input > input {
192+
display: inline-block !important;
192193
padding: 0 !important;
193194
min-height: 0 !important;
194195
max-height: none !important;

dist/css/selectize.bootstrap3.css

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* selectize.bootstrap3.css (v0.11.0) - Bootstrap 3 Theme
2+
* selectize.bootstrap3.css (v0.11.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
@@ -189,6 +189,7 @@
189189
border: 0 solid rgba(77, 77, 77, 0);
190190
}
191191
.selectize-input > input {
192+
display: inline-block !important;
192193
padding: 0 !important;
193194
min-height: 0 !important;
194195
max-height: none !important;
@@ -368,6 +369,16 @@
368369
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
369370
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
370371
}
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+
}
371382
.selectize-control.multi .selectize-input.has-items {
372383
padding-left: 9px;
373384
padding-right: 9px;

dist/css/selectize.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* selectize.css (v0.11.0)
2+
* selectize.css (v0.11.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
@@ -190,6 +190,7 @@
190190
border: 0 solid #ffffff;
191191
}
192192
.selectize-input > input {
193+
display: inline-block !important;
193194
padding: 0 !important;
194195
min-height: 0 !important;
195196
max-height: none !important;

dist/css/selectize.default.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* selectize.default.css (v0.11.0) - Default Theme
2+
* selectize.default.css (v0.11.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
@@ -189,6 +189,7 @@
189189
border: 1px solid #aaaaaa;
190190
}
191191
.selectize-input > input {
192+
display: inline-block !important;
192193
padding: 0 !important;
193194
min-height: 0 !important;
194195
max-height: none !important;

dist/css/selectize.legacy.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* selectize.legacy.css (v0.11.0) - Default Theme
2+
* selectize.legacy.css (v0.11.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
@@ -189,6 +189,7 @@
189189
border: 1px solid #b4b4b4;
190190
}
191191
.selectize-input > input {
192+
display: inline-block !important;
192193
padding: 0 !important;
193194
min-height: 0 !important;
194195
max-height: none !important;

dist/js/selectize.js

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* selectize.js (v0.11.0)
2+
* selectize.js (v0.11.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
@@ -467,7 +467,8 @@
467467
input.selectize = self;
468468

469469
// detect rtl environment
470-
dir = window.getComputedStyle ? window.getComputedStyle(input, null).getPropertyValue('direction') : input.currentStyle && input.currentStyle.direction;
470+
var computedStyle = window.getComputedStyle && window.getComputedStyle(input, null);
471+
dir = computedStyle ? computedStyle.getPropertyValue('direction') : input.currentStyle && input.currentStyle.direction;
471472
dir = dir || $input.parents('[dir]:first').attr('dir') || '';
472473

473474
// setup default state
@@ -528,16 +529,6 @@
528529
self.settings.hideSelected = self.settings.mode === 'multi';
529530
}
530531

531-
if (self.settings.create) {
532-
self.canCreate = function(input) {
533-
var filter = self.settings.createFilter;
534-
return input.length
535-
&& (typeof filter !== 'function' || filter.apply(self, [input]))
536-
&& (typeof filter !== 'string' || new RegExp(filter).test(input))
537-
&& (!(filter instanceof RegExp) || filter.test(input));
538-
};
539-
}
540-
541532
self.initializePlugins(self.settings.plugins);
542533
self.setupCallbacks();
543534
self.setupTemplates();
@@ -587,9 +578,14 @@
587578
$control = $('<div>').addClass(settings.inputClass).addClass('items').appendTo($wrapper);
588579
$control_input = $('<input type="text" autocomplete="off" />').appendTo($control).attr('tabindex', tab_index);
589580
$dropdown_parent = $(settings.dropdownParent || $wrapper);
590-
$dropdown = $('<div>').addClass(settings.dropdownClass).addClass(classes).addClass(inputMode).hide().appendTo($dropdown_parent);
581+
$dropdown = $('<div>').addClass(settings.dropdownClass).addClass(inputMode).hide().appendTo($dropdown_parent);
591582
$dropdown_content = $('<div>').addClass(settings.dropdownContentClass).appendTo($dropdown);
592583

584+
if(self.settings.copyClassesToDropdown) {
585+
debugger;
586+
$dropdown.addClass(classes);
587+
}
588+
593589
$wrapper.css({
594590
width: $input[0].style.width
595591
});
@@ -768,7 +764,8 @@
768764
'option_clear' : 'onOptionClear',
769765
'dropdown_open' : 'onDropdownOpen',
770766
'dropdown_close' : 'onDropdownClose',
771-
'type' : 'onType'
767+
'type' : 'onType',
768+
'load' : 'onLoad'
772769
};
773770

774771
for (key in callbacks) {
@@ -1440,7 +1437,7 @@
14401437
}
14411438

14421439
var self = this;
1443-
var query = self.$control_input.val();
1440+
var query = $.trim(self.$control_input.val());
14441441
var results = self.search(query);
14451442
var $dropdown_content = self.$dropdown_content;
14461443
var active_before = self.$activeOption && hash_key(self.$activeOption.attr('data-value'));
@@ -1516,7 +1513,7 @@
15161513
}
15171514

15181515
// add create option
1519-
has_create_option = self.settings.create && self.canCreate(results.query);
1516+
has_create_option = self.canCreate(query);
15201517
if (has_create_option) {
15211518
$dropdown_content.prepend(self.render('option_create', {input: query}));
15221519
$create = $($dropdown_content[0].childNodes[0]);
@@ -1645,6 +1642,9 @@
16451642
$item.replaceWith($item_new);
16461643
}
16471644

1645+
//invalidate last query because we might have updated the sortField
1646+
self.lastQuery = null;
1647+
16481648
// update dropdown contents
16491649
if (self.isOpen) {
16501650
self.refreshOptions(false);
@@ -2406,8 +2406,24 @@
24062406
} else {
24072407
delete self.renderCache[templateName];
24082408
}
2409-
}
2409+
},
24102410

2411+
/**
2412+
* Determines whether or not to display the
2413+
* create item prompt, given a user input.
2414+
*
2415+
* @param {string} input
2416+
* @return {boolean}
2417+
*/
2418+
canCreate: function(input) {
2419+
var self = this;
2420+
if (!self.settings.create) return false;
2421+
var filter = self.settings.createFilter;
2422+
return input.length
2423+
&& (typeof filter !== 'function' || filter.apply(self, [input]))
2424+
&& (typeof filter !== 'string' || new RegExp(filter).test(input))
2425+
&& (!(filter instanceof RegExp) || filter.test(input));
2426+
}
24112427

24122428
});
24132429

@@ -2454,6 +2470,8 @@
24542470

24552471
dropdownParent: null,
24562472

2473+
copyClassesToDropdown: true,
2474+
24572475
/*
24582476
load : null, // function(query, callback) { ... }
24592477
score : null, // function(search) { ... }
@@ -2482,6 +2500,7 @@
24822500
}
24832501
};
24842502

2503+
24852504
$.fn.selectize = function(settings_user) {
24862505
var defaults = $.fn.selectize.defaults;
24872506
var settings = $.extend({}, defaults, settings_user);

dist/js/selectize.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/standalone/selectize.js

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@
585585
}));
586586

587587
/**
588-
* selectize.js (v0.11.0)
588+
* selectize.js (v0.11.1)
589589
* Copyright (c) 2013 Brian Reavis & contributors
590590
*
591591
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
@@ -1053,7 +1053,8 @@
10531053
input.selectize = self;
10541054

10551055
// 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;
10571058
dir = dir || $input.parents('[dir]:first').attr('dir') || '';
10581059

10591060
// setup default state
@@ -1114,16 +1115,6 @@
11141115
self.settings.hideSelected = self.settings.mode === 'multi';
11151116
}
11161117

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-
11271118
self.initializePlugins(self.settings.plugins);
11281119
self.setupCallbacks();
11291120
self.setupTemplates();
@@ -1173,9 +1164,14 @@
11731164
$control = $('<div>').addClass(settings.inputClass).addClass('items').appendTo($wrapper);
11741165
$control_input = $('<input type="text" autocomplete="off" />').appendTo($control).attr('tabindex', tab_index);
11751166
$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);
11771168
$dropdown_content = $('<div>').addClass(settings.dropdownContentClass).appendTo($dropdown);
11781169

1170+
if(self.settings.copyClassesToDropdown) {
1171+
debugger;
1172+
$dropdown.addClass(classes);
1173+
}
1174+
11791175
$wrapper.css({
11801176
width: $input[0].style.width
11811177
});
@@ -1354,7 +1350,8 @@
13541350
'option_clear' : 'onOptionClear',
13551351
'dropdown_open' : 'onDropdownOpen',
13561352
'dropdown_close' : 'onDropdownClose',
1357-
'type' : 'onType'
1353+
'type' : 'onType',
1354+
'load' : 'onLoad'
13581355
};
13591356

13601357
for (key in callbacks) {
@@ -2026,7 +2023,7 @@
20262023
}
20272024

20282025
var self = this;
2029-
var query = self.$control_input.val();
2026+
var query = $.trim(self.$control_input.val());
20302027
var results = self.search(query);
20312028
var $dropdown_content = self.$dropdown_content;
20322029
var active_before = self.$activeOption && hash_key(self.$activeOption.attr('data-value'));
@@ -2102,7 +2099,7 @@
21022099
}
21032100

21042101
// add create option
2105-
has_create_option = self.settings.create && self.canCreate(results.query);
2102+
has_create_option = self.canCreate(query);
21062103
if (has_create_option) {
21072104
$dropdown_content.prepend(self.render('option_create', {input: query}));
21082105
$create = $($dropdown_content[0].childNodes[0]);
@@ -2231,6 +2228,9 @@
22312228
$item.replaceWith($item_new);
22322229
}
22332230

2231+
//invalidate last query because we might have updated the sortField
2232+
self.lastQuery = null;
2233+
22342234
// update dropdown contents
22352235
if (self.isOpen) {
22362236
self.refreshOptions(false);
@@ -2992,8 +2992,24 @@
29922992
} else {
29932993
delete self.renderCache[templateName];
29942994
}
2995-
}
2995+
},
29962996

2997+
/**
2998+
* Determines whether or not to display the
2999+
* create item prompt, given a user input.
3000+
*
3001+
* @param {string} input
3002+
* @return {boolean}
3003+
*/
3004+
canCreate: function(input) {
3005+
var self = this;
3006+
if (!self.settings.create) return false;
3007+
var filter = self.settings.createFilter;
3008+
return input.length
3009+
&& (typeof filter !== 'function' || filter.apply(self, [input]))
3010+
&& (typeof filter !== 'string' || new RegExp(filter).test(input))
3011+
&& (!(filter instanceof RegExp) || filter.test(input));
3012+
}
29973013

29983014
});
29993015

@@ -3040,6 +3056,8 @@
30403056

30413057
dropdownParent: null,
30423058

3059+
copyClassesToDropdown: true,
3060+
30433061
/*
30443062
load : null, // function(query, callback) { ... }
30453063
score : null, // function(search) { ... }
@@ -3068,6 +3086,7 @@
30683086
}
30693087
};
30703088

3089+
30713090
$.fn.selectize = function(settings_user) {
30723091
var defaults = $.fn.selectize.defaults;
30733092
var settings = $.extend({}, defaults, settings_user);

dist/js/standalone/selectize.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/less/selectize.bootstrap2.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* selectize.bootstrap2.css (v0.11.0) - Bootstrap 2 Theme
2+
* selectize.bootstrap2.css (v0.11.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

0 commit comments

Comments
 (0)