Skip to content

Commit

Permalink
release 0.7.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel van Rijn committed Sep 16, 2013
1 parent 6f9e37a commit 4f57968
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 22 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.7.7 | Update to v0.7.7 of selectize.js |
| 0.7.6 | Update to v0.7.6 of selectize.js |
| 0.7.5 | Update to v0.7.5 of selectize.js |
| 0.7.4 | Update to v0.7.4 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.7.6"
VERSION = "0.7.7"
end
end
42 changes: 26 additions & 16 deletions vendor/assets/javascripts/selectize.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@
}));

/**
* selectize.js (v0.7.6)
* selectize.js (v0.7.7)
* 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 @@ -628,17 +628,6 @@
.replace(/"/g, '"');
};

/**
* Escapes quotation marks with backslashes. Useful
* for escaping values for use in CSS attribute selectors.
*
* @param {string} str
* @return {string}
*/
var escape_quotes = function(str) {
return str.replace(/(['"])/g, '\\$1');
};

var hook = {};

/**
Expand Down Expand Up @@ -1900,7 +1889,7 @@
*/
addOptionGroup: function(id, data) {
this.optgroups[id] = data;
this.trigger('optgroup_add', value, data);
this.trigger('optgroup_add', id, data);
},

/**
Expand Down Expand Up @@ -1998,8 +1987,7 @@
* @returns {object}
*/
getOption: function(value) {
value = hash_key(value);
return value ? this.$dropdown_content.find('[data-selectable]').filter('[data-value="' + escape_quotes(value) + '"]:first') : $();
return this.getElementWithValue(value, this.$dropdown_content.find('[data-selectable]'));
},

/**
Expand All @@ -2017,6 +2005,28 @@
return index >= 0 && index < $options.length ? $options.eq(index) : $();
},

/**
* Finds the first element with a "data-value" attribute
* that matches the given value.
*
* @param {mixed} value
* @param {object} $els
* @return {object}
*/
getElementWithValue: function(value, $els) {
value = hash_key(value);

if (value) {
for (var i = 0, n = $els.length; i < n; i++) {
if ($els[i].getAttribute('data-value') === value) {
return $($els[i]);
}
}
}

return $();
},

/**
* Returns the jQuery element of the item
* matching the given value.
Expand All @@ -2025,7 +2035,7 @@
* @returns {object}
*/
getItem: function(value) {
return this.$control.children('[data-value="' + escape_quotes(hash_key(value)) + '"]');
return this.getElementWithValue(value, this.$control.children());
},

/**
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.7.6) - Bootstrap 2 Theme
* selectize.bootstrap2.css (v0.7.7) - 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.7.6) - Bootstrap 3 Theme
* selectize.bootstrap3.css (v0.7.7) - 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.7.6)
* selectize.css (v0.7.7)
* 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.7.6) - Default Theme
* selectize.default.css (v0.7.7) - 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.7.6) - Default Theme
* selectize.legacy.css (v0.7.7) - 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 4f57968

Please sign in to comment.