Skip to content

Commit

Permalink
updated vendor to v0.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel van Rijn committed Nov 13, 2013
1 parent c182b0f commit 49f3871
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 20 deletions.
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.8.3 | Update to v0.8.3 of selectize.js |
| 0.8.1 | Update to v0.8.1 of selectize.js |
| 0.8.0 | Update to v0.8.0 of selectize.js |
| 0.7.7 | Update to v0.7.7 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.8.1"
VERSION = "0.8.3"
end
end
45 changes: 31 additions & 14 deletions vendor/assets/javascripts/selectize.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@
}));

/**
* selectize.js (v0.8.1)
* selectize.js (v0.8.3)
* 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 @@ -741,6 +741,16 @@
.replace(/"/g, '"');
};

/**
* Escapes "$" characters in replacement strings.
*
* @param {string} str
* @returns {string}
*/
var escape_replace = function(str) {
return (str + '').replace(/\$/g, '$$$$');
};

var hook = {};

/**
Expand Down Expand Up @@ -1042,7 +1052,7 @@
highlightedValue : null,
isOpen : false,
isDisabled : false,
isRequired : $input.is(':required'),
isRequired : $input.is('[required]'),
isInvalid : false,
isLocked : false,
isFocused : false,
Expand Down Expand Up @@ -1418,7 +1428,7 @@
}
break;
case KEY_ESC:
self.blur();
self.close();
return;
case KEY_DOWN:
if (!self.isOpen && self.hasOptions) {
Expand Down Expand Up @@ -1517,7 +1527,7 @@
self.isFocused = true;
if (self.isDisabled) {
self.blur();
e.preventDefault();
e && e.preventDefault();
return false;
}

Expand Down Expand Up @@ -1585,6 +1595,7 @@
} else {
value = $target.attr('data-value');
if (value) {
self.lastQuery = null;
self.setTextboxValue('');
self.addItem(value);
if (!self.settings.hideSelected && e.type && /mouse/.test(e.type)) {
Expand Down Expand Up @@ -1772,7 +1783,7 @@
scroll_top = y;
scroll_bottom = y - height_menu + height_item;

if (y + height_item > height_menu - scroll) {
if (y + height_item > height_menu + scroll) {
self.$dropdown_content.stop().animate({scrollTop: scroll_bottom}, animate ? self.settings.scrollDuration : 0);
} else if (y < scroll) {
self.$dropdown_content.stop().animate({scrollTop: scroll_top}, animate ? self.settings.scrollDuration : 0);
Expand Down Expand Up @@ -2250,10 +2261,14 @@
var i, active, options, value_next;
value = hash_key(value);

if (self.items.indexOf(value) !== -1) {
if (inputMode === 'single') self.close();
return;
}

if (!self.options.hasOwnProperty(value)) return;
if (inputMode === 'single') self.clear();
if (inputMode === 'multi' && self.isFull()) return;
if (self.items.indexOf(value) !== -1) return;
if (!self.options.hasOwnProperty(value)) return;

$item = $(self.render('item', self.options[value]));
self.items.splice(self.caretPos, 0, value);
Expand Down Expand Up @@ -2402,10 +2417,10 @@
var isFull = self.isFull();
var isLocked = self.isLocked;

this.$wrapper
self.$wrapper
.toggleClass('rtl', self.rtl);

this.$control
self.$control
.toggleClass('focus', self.isFocused)
.toggleClass('disabled', self.isDisabled)
.toggleClass('required', self.isRequired)
Expand All @@ -2417,7 +2432,7 @@
.toggleClass('has-options', !$.isEmptyObject(self.options))
.toggleClass('has-items', self.items.length > 0);

this.$control_input.data('grow', !isFull && !isLocked);
self.$control_input.data('grow', !isFull && !isLocked);
},

/**
Expand Down Expand Up @@ -2485,7 +2500,7 @@
self.$dropdown.css({visibility: 'hidden', display: 'block'});
self.positionDropdown();
self.$dropdown.css({visibility: 'visible'});
self.trigger('dropdown_open', this.$dropdown);
self.trigger('dropdown_open', self.$dropdown);
},

/**
Expand All @@ -2495,7 +2510,7 @@
var self = this;
var trigger = self.isOpen;

if (self.settings.mode === 'single' && this.items.length) {
if (self.settings.mode === 'single' && self.items.length) {
self.hideInput();
}

Expand Down Expand Up @@ -2776,6 +2791,7 @@
self.$input
.html('')
.append(revertSettings.$children)
.removeAttr('tabindex')
.attr({tabindex: revertSettings.tabindex})
.show();

Expand Down Expand Up @@ -2825,10 +2841,10 @@
}
if (templateName === 'optgroup') {
id = data[self.settings.optgroupValueField] || '';
html = html.replace(regex_tag, '<$1 data-group="' + escape_html(id) + '"');
html = html.replace(regex_tag, '<$1 data-group="' + escape_replace(escape_html(id)) + '"');
}
if (templateName === 'option' || templateName === 'item') {
html = html.replace(regex_tag, '<$1 data-value="' + escape_html(value || '') + '"');
html = html.replace(regex_tag, '<$1 data-value="' + escape_replace(escape_html(value || '')) + '"');
}

// update cache
Expand All @@ -2841,6 +2857,7 @@

});


Selectize.count = 0;
Selectize.defaults = {
plugins: [],
Expand Down
2 changes: 1 addition & 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.8.1) - Bootstrap 2 Theme
* selectize.bootstrap2.css (v0.8.3) - 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
2 changes: 1 addition & 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.8.1) - Bootstrap 3 Theme
* selectize.bootstrap3.css (v0.8.3) - 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
2 changes: 1 addition & 1 deletion vendor/assets/stylesheets/selectize.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.css (v0.8.1)
* selectize.css (v0.8.3)
* Copyright (c) 2013 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
Expand Down
2 changes: 1 addition & 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.8.1) - Default Theme
* selectize.default.css (v0.8.3) - 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
2 changes: 1 addition & 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.8.1) - Default Theme
* selectize.legacy.css (v0.8.3) - 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

0 comments on commit 49f3871

Please sign in to comment.