Skip to content

Commit

Permalink
Merge branch 'feature/version-0.9.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelvanrijn committed May 7, 2014
2 parents 2a0b99e + 10f155c commit b673061
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 26 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

| Version | Notes |
| -------:| ----------------------------------------------------------- |
| 0.9.1 | Update to v0.9.1 of selectize.js |
| 0.9.0 | Update to v0.9.0 of selectize.js |
| 0.8.5 | Update to v0.8.5 of selectize.js |
| 0.8.4 | Update to v0.8.4 of selectize.js |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ See the [demo page of Brian Reavis](http://brianreavis.github.io/selectize.js/)

| Version | Notes |
| -------:| ----------------------------------------------------------- |
| 0.9.1 | Update to v0.9.1 of selectize.js |
| 0.9.0 | Update to v0.9.0 of selectize.js |
| 0.8.5 | Update to v0.8.5 of selectize.js |
| 0.8.4 | Update to v0.8.4 of selectize.js |
| 0.8.3 | Update to v0.8.3 of selectize.js |
| 0.8.1 | Update to v0.8.1 of selectize.js |

[older](CHANGELOG.md)

Expand Down
2 changes: 1 addition & 1 deletion lib/selectize-rails/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Selectize
module Rails
VERSION = "0.9.0"
VERSION = "0.9.1"
end
end
74 changes: 55 additions & 19 deletions vendor/assets/javascripts/selectize.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@
}));

/**
* 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 @@ -957,7 +957,7 @@
if (!str) {
return 0;
}

var $test = $('<test>').css({
position: 'absolute',
top: -99999,
Expand Down Expand Up @@ -992,14 +992,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 @@ -1029,8 +1030,8 @@
}
}

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

Expand Down Expand Up @@ -1092,7 +1093,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 @@ -1181,6 +1182,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 @@ -1204,7 +1213,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 @@ -1401,6 +1411,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 @@ -1445,7 +1469,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 @@ -1457,7 +1481,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 @@ -1479,7 +1503,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 @@ -1491,7 +1515,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 @@ -1677,8 +1702,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 @@ -2159,11 +2188,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 @@ -2189,8 +2218,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 @@ -2206,6 +2240,7 @@

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

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

scrollDuration: 60,
Expand Down
7 changes: 6 additions & 1 deletion vendor/assets/stylesheets/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 vendor/assets/stylesheets/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 vendor/assets/stylesheets/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 vendor/assets/stylesheets/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 vendor/assets/stylesheets/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

0 comments on commit b673061

Please sign in to comment.