Skip to content

Commit

Permalink
Released 0.11.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianreavis committed Sep 23, 2014
1 parent bd95ccf commit 20da6e5
Show file tree
Hide file tree
Showing 17 changed files with 121 additions and 53 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.11.0",
"version": "0.11.1",
"license": "Apache License, Version 2.0",
"readmeFilename": "README.md",
"repository": {
Expand Down
3 changes: 2 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.11.0) - Bootstrap 2 Theme
* selectize.bootstrap2.css (v0.11.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 @@ -189,6 +189,7 @@
border: 1px solid #e0e0e0;
}
.selectize-input > input {
display: inline-block !important;
padding: 0 !important;
min-height: 0 !important;
max-height: none !important;
Expand Down
13 changes: 12 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.11.0) - Bootstrap 3 Theme
* selectize.bootstrap3.css (v0.11.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 @@ -189,6 +189,7 @@
border: 0 solid rgba(77, 77, 77, 0);
}
.selectize-input > input {
display: inline-block !important;
padding: 0 !important;
min-height: 0 !important;
max-height: none !important;
Expand Down Expand Up @@ -368,6 +369,16 @@
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
.has-error .selectize-input {
border-color: #a94442;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.has-error .selectize-input:focus {
border-color: #843534;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
}
.selectize-control.multi .selectize-input.has-items {
padding-left: 9px;
padding-right: 9px;
Expand Down
3 changes: 2 additions & 1 deletion dist/css/selectize.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.css (v0.11.0)
* selectize.css (v0.11.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 @@ -190,6 +190,7 @@
border: 0 solid #ffffff;
}
.selectize-input > input {
display: inline-block !important;
padding: 0 !important;
min-height: 0 !important;
max-height: none !important;
Expand Down
3 changes: 2 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.11.0) - Default Theme
* selectize.default.css (v0.11.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 @@ -189,6 +189,7 @@
border: 1px solid #aaaaaa;
}
.selectize-input > input {
display: inline-block !important;
padding: 0 !important;
min-height: 0 !important;
max-height: none !important;
Expand Down
3 changes: 2 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.11.0) - Default Theme
* selectize.legacy.css (v0.11.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 @@ -189,6 +189,7 @@
border: 1px solid #b4b4b4;
}
.selectize-input > input {
display: inline-block !important;
padding: 0 !important;
min-height: 0 !important;
max-height: none !important;
Expand Down
53 changes: 36 additions & 17 deletions dist/js/selectize.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.js (v0.11.0)
* selectize.js (v0.11.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 @@ -467,7 +467,8 @@
input.selectize = self;

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

// setup default state
Expand Down Expand Up @@ -528,16 +529,6 @@
self.settings.hideSelected = self.settings.mode === 'multi';
}

if (self.settings.create) {
self.canCreate = function(input) {
var filter = self.settings.createFilter;
return input.length
&& (typeof filter !== 'function' || filter.apply(self, [input]))
&& (typeof filter !== 'string' || new RegExp(filter).test(input))
&& (!(filter instanceof RegExp) || filter.test(input));
};
}

self.initializePlugins(self.settings.plugins);
self.setupCallbacks();
self.setupTemplates();
Expand Down Expand Up @@ -587,9 +578,14 @@
$control = $('<div>').addClass(settings.inputClass).addClass('items').appendTo($wrapper);
$control_input = $('<input type="text" autocomplete="off" />').appendTo($control).attr('tabindex', tab_index);
$dropdown_parent = $(settings.dropdownParent || $wrapper);
$dropdown = $('<div>').addClass(settings.dropdownClass).addClass(classes).addClass(inputMode).hide().appendTo($dropdown_parent);
$dropdown = $('<div>').addClass(settings.dropdownClass).addClass(inputMode).hide().appendTo($dropdown_parent);
$dropdown_content = $('<div>').addClass(settings.dropdownContentClass).appendTo($dropdown);

if(self.settings.copyClassesToDropdown) {
debugger;
$dropdown.addClass(classes);
}

$wrapper.css({
width: $input[0].style.width
});
Expand Down Expand Up @@ -768,7 +764,8 @@
'option_clear' : 'onOptionClear',
'dropdown_open' : 'onDropdownOpen',
'dropdown_close' : 'onDropdownClose',
'type' : 'onType'
'type' : 'onType',
'load' : 'onLoad'
};

for (key in callbacks) {
Expand Down Expand Up @@ -1440,7 +1437,7 @@
}

var self = this;
var query = self.$control_input.val();
var query = $.trim(self.$control_input.val());
var results = self.search(query);
var $dropdown_content = self.$dropdown_content;
var active_before = self.$activeOption && hash_key(self.$activeOption.attr('data-value'));
Expand Down Expand Up @@ -1516,7 +1513,7 @@
}

// add create option
has_create_option = self.settings.create && self.canCreate(results.query);
has_create_option = self.canCreate(query);
if (has_create_option) {
$dropdown_content.prepend(self.render('option_create', {input: query}));
$create = $($dropdown_content[0].childNodes[0]);
Expand Down Expand Up @@ -1645,6 +1642,9 @@
$item.replaceWith($item_new);
}

//invalidate last query because we might have updated the sortField
self.lastQuery = null;

// update dropdown contents
if (self.isOpen) {
self.refreshOptions(false);
Expand Down Expand Up @@ -2406,8 +2406,24 @@
} else {
delete self.renderCache[templateName];
}
}
},

/**
* Determines whether or not to display the
* create item prompt, given a user input.
*
* @param {string} input
* @return {boolean}
*/
canCreate: function(input) {
var self = this;
if (!self.settings.create) return false;
var filter = self.settings.createFilter;
return input.length
&& (typeof filter !== 'function' || filter.apply(self, [input]))
&& (typeof filter !== 'string' || new RegExp(filter).test(input))
&& (!(filter instanceof RegExp) || filter.test(input));
}

});

Expand Down Expand Up @@ -2454,6 +2470,8 @@

dropdownParent: null,

copyClassesToDropdown: true,

/*
load : null, // function(query, callback) { ... }
score : null, // function(search) { ... }
Expand Down Expand Up @@ -2482,6 +2500,7 @@
}
};


$.fn.selectize = function(settings_user) {
var defaults = $.fn.selectize.defaults;
var settings = $.extend({}, defaults, settings_user);
Expand Down
6 changes: 3 additions & 3 deletions dist/js/selectize.min.js

Large diffs are not rendered by default.

53 changes: 36 additions & 17 deletions dist/js/standalone/selectize.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@
}));

/**
* selectize.js (v0.11.0)
* selectize.js (v0.11.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 @@ -1053,7 +1053,8 @@
input.selectize = self;

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

// setup default state
Expand Down Expand Up @@ -1114,16 +1115,6 @@
self.settings.hideSelected = self.settings.mode === 'multi';
}

if (self.settings.create) {
self.canCreate = function(input) {
var filter = self.settings.createFilter;
return input.length
&& (typeof filter !== 'function' || filter.apply(self, [input]))
&& (typeof filter !== 'string' || new RegExp(filter).test(input))
&& (!(filter instanceof RegExp) || filter.test(input));
};
}

self.initializePlugins(self.settings.plugins);
self.setupCallbacks();
self.setupTemplates();
Expand Down Expand Up @@ -1173,9 +1164,14 @@
$control = $('<div>').addClass(settings.inputClass).addClass('items').appendTo($wrapper);
$control_input = $('<input type="text" autocomplete="off" />').appendTo($control).attr('tabindex', tab_index);
$dropdown_parent = $(settings.dropdownParent || $wrapper);
$dropdown = $('<div>').addClass(settings.dropdownClass).addClass(classes).addClass(inputMode).hide().appendTo($dropdown_parent);
$dropdown = $('<div>').addClass(settings.dropdownClass).addClass(inputMode).hide().appendTo($dropdown_parent);
$dropdown_content = $('<div>').addClass(settings.dropdownContentClass).appendTo($dropdown);

if(self.settings.copyClassesToDropdown) {
debugger;
$dropdown.addClass(classes);
}

$wrapper.css({
width: $input[0].style.width
});
Expand Down Expand Up @@ -1354,7 +1350,8 @@
'option_clear' : 'onOptionClear',
'dropdown_open' : 'onDropdownOpen',
'dropdown_close' : 'onDropdownClose',
'type' : 'onType'
'type' : 'onType',
'load' : 'onLoad'
};

for (key in callbacks) {
Expand Down Expand Up @@ -2026,7 +2023,7 @@
}

var self = this;
var query = self.$control_input.val();
var query = $.trim(self.$control_input.val());
var results = self.search(query);
var $dropdown_content = self.$dropdown_content;
var active_before = self.$activeOption && hash_key(self.$activeOption.attr('data-value'));
Expand Down Expand Up @@ -2102,7 +2099,7 @@
}

// add create option
has_create_option = self.settings.create && self.canCreate(results.query);
has_create_option = self.canCreate(query);
if (has_create_option) {
$dropdown_content.prepend(self.render('option_create', {input: query}));
$create = $($dropdown_content[0].childNodes[0]);
Expand Down Expand Up @@ -2231,6 +2228,9 @@
$item.replaceWith($item_new);
}

//invalidate last query because we might have updated the sortField
self.lastQuery = null;

// update dropdown contents
if (self.isOpen) {
self.refreshOptions(false);
Expand Down Expand Up @@ -2992,8 +2992,24 @@
} else {
delete self.renderCache[templateName];
}
}
},

/**
* Determines whether or not to display the
* create item prompt, given a user input.
*
* @param {string} input
* @return {boolean}
*/
canCreate: function(input) {
var self = this;
if (!self.settings.create) return false;
var filter = self.settings.createFilter;
return input.length
&& (typeof filter !== 'function' || filter.apply(self, [input]))
&& (typeof filter !== 'string' || new RegExp(filter).test(input))
&& (!(filter instanceof RegExp) || filter.test(input));
}

});

Expand Down Expand Up @@ -3040,6 +3056,8 @@

dropdownParent: null,

copyClassesToDropdown: true,

/*
load : null, // function(query, callback) { ... }
score : null, // function(search) { ... }
Expand Down Expand Up @@ -3068,6 +3086,7 @@
}
};


$.fn.selectize = function(settings_user) {
var defaults = $.fn.selectize.defaults;
var settings = $.extend({}, defaults, settings_user);
Expand Down
6 changes: 3 additions & 3 deletions dist/js/standalone/selectize.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/less/selectize.bootstrap2.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.bootstrap2.css (v0.11.0) - Bootstrap 2 Theme
* selectize.bootstrap2.css (v0.11.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
Loading

0 comments on commit 20da6e5

Please sign in to comment.