Skip to content

Commit

Permalink
update assets to 0.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelvanrijn committed Oct 24, 2014
1 parent 03869a8 commit c1e105a
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 24 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.11.2 | Update to v0.11.2 of selectize.js |
| 0.11.0 | Update to v0.11.0 of selectize.js |
| 0.9.1 | Update to v0.9.1 of selectize.js |
| 0.9.0 | Update to v0.9.0 of selectize.js |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ See the [demo page of Brian Reavis](http://brianreavis.github.io/selectize.js/)

| Version | Notes |
| --------:| ----------------------------------------------------------- |
| 0.11.2 | Update to v0.11.2 of selectize.js |
| 0.11.0 | Update to v0.11.0 of selectize.js |
| 0.9.1 | Update to v0.9.1 of selectize.js |
| 0.9.0 | Update to v0.9.0 of selectize.js |
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.11.0"
VERSION = "0.11.2"
end
end
2 changes: 1 addition & 1 deletion update_from_vendor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ cp tmp_vendor/dist/css/*.css vendor/assets/stylesheets/

# Delete vendor repo
echo "Removing cloned vendor repo"
# rm -rf tmp_vendor
rm -rf tmp_vendor

echo "Finished... You'll need to commit the changes. You should consider updating the changelog and gem version number"
52 changes: 35 additions & 17 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.11.0)
* selectize.js (v0.11.2)
* 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,13 @@
$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) {
$dropdown.addClass(classes);
}

$wrapper.css({
width: $input[0].style.width
});
Expand Down Expand Up @@ -1354,7 +1349,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 +2022,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 +2098,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 +2227,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 +2991,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 +3055,8 @@

dropdownParent: null,

copyClassesToDropdown: true,

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


$.fn.selectize = function(settings_user) {
var defaults = $.fn.selectize.defaults;
var settings = $.extend({}, defaults, settings_user);
Expand Down
3 changes: 2 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.11.0) - Bootstrap 2 Theme
* selectize.bootstrap2.css (v0.11.2) - 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 vendor/assets/stylesheets/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.2) - 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 vendor/assets/stylesheets/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.2)
* 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 vendor/assets/stylesheets/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.2) - 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 vendor/assets/stylesheets/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.2) - 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

0 comments on commit c1e105a

Please sign in to comment.