Skip to content

Commit

Permalink
Released 0.9.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianreavis committed Apr 30, 2014
1 parent 59e2004 commit 6caddcc
Show file tree
Hide file tree
Showing 18 changed files with 157 additions and 56 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "selectize",
"keywords": ["select", "ui", "form", "input", "control", "autocomplete", "tagging", "tag"],
"description": "Selectize is a jQuery-based custom <select> UI control. Useful for tagging, contact lists, country selectors, etc.",
"version": "0.9.0",
"version": "0.9.1",
"license": "Apache License, Version 2.0",
"readmeFilename": "README.md",
"repository": {
Expand Down
7 changes: 6 additions & 1 deletion dist/css/selectize.bootstrap2.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.bootstrap2.css (v0.9.0) - Bootstrap 2 Theme
* selectize.bootstrap2.css (v0.9.1) - Bootstrap 2 Theme
* Copyright (c) 2013 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
Expand Down Expand Up @@ -73,6 +73,8 @@
padding-right: 24px !important;
}
.selectize-control.plugin-remove_button [data-value] .remove {
z-index: 1;
/* fixes ie bug (see #392) */
position: absolute;
top: 0;
right: 0;
Expand Down Expand Up @@ -200,6 +202,9 @@
-webkit-box-shadow: none !important;
box-shadow: none !important;
}
.selectize-input > input::-ms-clear {
display: none;
}
.selectize-input > input:focus {
outline: none !important;
}
Expand Down
7 changes: 6 additions & 1 deletion dist/css/selectize.bootstrap3.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.bootstrap3.css (v0.9.0) - Bootstrap 3 Theme
* selectize.bootstrap3.css (v0.9.1) - Bootstrap 3 Theme
* Copyright (c) 2013 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
Expand Down Expand Up @@ -73,6 +73,8 @@
padding-right: 24px !important;
}
.selectize-control.plugin-remove_button [data-value] .remove {
z-index: 1;
/* fixes ie bug (see #392) */
position: absolute;
top: 0;
right: 0;
Expand Down Expand Up @@ -200,6 +202,9 @@
-webkit-box-shadow: none !important;
box-shadow: none !important;
}
.selectize-input > input::-ms-clear {
display: none;
}
.selectize-input > input:focus {
outline: none !important;
}
Expand Down
7 changes: 6 additions & 1 deletion dist/css/selectize.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.css (v0.9.0)
* selectize.css (v0.9.1)
* Copyright (c) 2013 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
Expand Down Expand Up @@ -74,6 +74,8 @@
padding-right: 24px !important;
}
.selectize-control.plugin-remove_button [data-value] .remove {
z-index: 1;
/* fixes ie bug (see #392) */
position: absolute;
top: 0;
right: 0;
Expand Down Expand Up @@ -201,6 +203,9 @@
-webkit-box-shadow: none !important;
box-shadow: none !important;
}
.selectize-input > input::-ms-clear {
display: none;
}
.selectize-input > input:focus {
outline: none !important;
}
Expand Down
7 changes: 6 additions & 1 deletion dist/css/selectize.default.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.default.css (v0.9.0) - Default Theme
* selectize.default.css (v0.9.1) - Default Theme
* Copyright (c) 2013 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
Expand Down Expand Up @@ -73,6 +73,8 @@
padding-right: 24px !important;
}
.selectize-control.plugin-remove_button [data-value] .remove {
z-index: 1;
/* fixes ie bug (see #392) */
position: absolute;
top: 0;
right: 0;
Expand Down Expand Up @@ -200,6 +202,9 @@
-webkit-box-shadow: none !important;
box-shadow: none !important;
}
.selectize-input > input::-ms-clear {
display: none;
}
.selectize-input > input:focus {
outline: none !important;
}
Expand Down
7 changes: 6 additions & 1 deletion dist/css/selectize.legacy.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.legacy.css (v0.9.0) - Default Theme
* selectize.legacy.css (v0.9.1) - Default Theme
* Copyright (c) 2013 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
Expand Down Expand Up @@ -73,6 +73,8 @@
padding-right: 24px !important;
}
.selectize-control.plugin-remove_button [data-value] .remove {
z-index: 1;
/* fixes ie bug (see #392) */
position: absolute;
top: 0;
right: 0;
Expand Down Expand Up @@ -200,6 +202,9 @@
-webkit-box-shadow: none !important;
box-shadow: none !important;
}
.selectize-input > input::-ms-clear {
display: none;
}
.selectize-input > input:focus {
outline: none !important;
}
Expand Down
74 changes: 55 additions & 19 deletions dist/js/selectize.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.js (v0.9.0)
* selectize.js (v0.9.1)
* Copyright (c) 2013 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
Expand Down Expand Up @@ -371,7 +371,7 @@
if (!str) {
return 0;
}

var $test = $('<test>').css({
position: 'absolute',
top: -99999,
Expand Down Expand Up @@ -406,14 +406,15 @@
*/
var autoGrow = function($input) {
var currentWidth = null;
var update = function(e) {

var update = function(e, options) {
var value, keyCode, printable, placeholder, width;
var shift, character, selection;
e = e || window.event || {};
options = options || {};

if (e.metaKey || e.altKey) return;
if ($input.data('grow') === false) return;
if (!options.force && $input.data('grow') === false) return;

value = $input.val();
if (e.type && e.type.toLowerCase() === 'keydown') {
Expand Down Expand Up @@ -443,8 +444,8 @@
}
}

placeholder = $input.attr('placeholder') || '';
if (!value.length && placeholder.length) {
placeholder = $input.attr('placeholder');
if (!value && placeholder) {
value = placeholder;
}

Expand Down Expand Up @@ -506,7 +507,7 @@
userOptions : {},
items : [],
renderCache : {},
onSearchChange : debounce(self.onSearchChange, settings.loadThrottle)
onSearchChange : settings.loadThrottle === null ? self.onSearchChange : debounce(self.onSearchChange, settings.loadThrottle)
});

// search system
Expand Down Expand Up @@ -595,6 +596,14 @@
$control_input.attr('placeholder', settings.placeholder);
}

if (self.$input.attr('autocorrect')) {
$control_input.attr('autocorrect', self.$input.attr('autocorrect'));
}

if (self.$input.attr('autocapitalize')) {
$control_input.attr('autocapitalize', self.$input.attr('autocapitalize'));
}

self.$wrapper = $wrapper;
self.$control = $control;
self.$control_input = $control_input;
Expand All @@ -618,7 +627,8 @@
keypress : function() { return self.onKeyPress.apply(self, arguments); },
resize : function() { self.positionDropdown.apply(self, []); },
blur : function() { return self.onBlur.apply(self, arguments); },
focus : function() { return self.onFocus.apply(self, arguments); }
focus : function() { return self.onFocus.apply(self, arguments); },
paste : function() { return self.onPaste.apply(self, arguments); }
});

$document.on('keydown' + eventNS, function(e) {
Expand Down Expand Up @@ -815,6 +825,20 @@
this.$input.trigger('change');
},


/**
* Triggered on <input> paste.
*
* @param {object} e
* @returns {boolean}
*/
onPaste: function(e) {
var self = this;
if (self.isFull() || self.isInputHidden || self.isLocked) {
e.preventDefault();
}
},

/**
* Triggered on <input> keypress.
*
Expand Down Expand Up @@ -859,7 +883,7 @@
self.close();
return;
case KEY_N:
if (!e.ctrlKey) break;
if (!e.ctrlKey || e.altKey) break;
case KEY_DOWN:
if (!self.isOpen && self.hasOptions) {
self.open();
Expand All @@ -871,7 +895,7 @@
e.preventDefault();
return;
case KEY_P:
if (!e.ctrlKey) break;
if (!e.ctrlKey || e.altKey) break;
case KEY_UP:
if (self.$activeOption) {
self.ignoreHover = true;
Expand All @@ -893,7 +917,7 @@
self.advanceSelection(1, e);
return;
case KEY_TAB:
if (self.isOpen && self.$activeOption) {
if (self.settings.selectOnTab && self.isOpen && self.$activeOption) {
self.onOptionSelect({currentTarget: self.$activeOption});
}
if (self.settings.create && self.createItem()) {
Expand All @@ -905,7 +929,8 @@
self.deleteSelection(e);
return;
}
if (self.isFull() || self.isInputHidden) {

if ((self.isFull() || self.isInputHidden) && !(IS_MAC ? e.metaKey : e.ctrlKey)) {
e.preventDefault();
return;
}
Expand Down Expand Up @@ -1091,8 +1116,12 @@
* @param {string} value
*/
setTextboxValue: function(value) {
this.$control_input.val(value).triggerHandler('update');
this.lastValue = value;
var $input = this.$control_input;
var changed = $input.val() !== value;
if (changed) {
$input.val(value).triggerHandler('update');
this.lastValue = value;
}
},

/**
Expand Down Expand Up @@ -1573,11 +1602,11 @@
cache_items = self.renderCache['item'];
cache_options = self.renderCache['option'];

if (isset(cache_items)) {
if (cache_items) {
delete cache_items[value];
delete cache_items[value_new];
}
if (isset(cache_options)) {
if (cache_options) {
delete cache_options[value];
delete cache_options[value_new];
}
Expand All @@ -1603,8 +1632,13 @@
*/
removeOption: function(value) {
var self = this;

value = hash_key(value);

var cache_items = self.renderCache['item'];
var cache_options = self.renderCache['option'];
if (cache_items) delete cache_items[value];
if (cache_options) delete cache_options[value];

delete self.userOptions[value];
delete self.options[value];
self.lastQuery = null;
Expand All @@ -1620,6 +1654,7 @@

self.loadedSearches = {};
self.userOptions = {};
self.renderCache = {};
self.options = self.sifter.items = {};
self.lastQuery = null;
self.trigger('option_clear');
Expand Down Expand Up @@ -1945,7 +1980,7 @@
} else {
$input.attr('placeholder', this.settings.placeholder);
}
$input.triggerHandler('update');
$input.triggerHandler('update', {force: true});
},

/**
Expand Down Expand Up @@ -2335,6 +2370,7 @@
maxItems: null,
hideSelected: null,
addPrecedence: false,
selectOnTab: false,
preload: false,

scrollDuration: 60,
Expand Down
6 changes: 3 additions & 3 deletions dist/js/selectize.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 6caddcc

Please sign in to comment.