selectize-rails 0.7.6 → 0.7.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -0
- data/lib/selectize-rails/version.rb +1 -1
- data/vendor/assets/javascripts/selectize.js +26 -16
- data/vendor/assets/stylesheets/selectize.bootstrap2.css +1 -1
- data/vendor/assets/stylesheets/selectize.bootstrap3.css +1 -1
- data/vendor/assets/stylesheets/selectize.css +1 -1
- data/vendor/assets/stylesheets/selectize.default.css +1 -1
- data/vendor/assets/stylesheets/selectize.legacy.css +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -41,6 +41,7 @@ See the [demo page of Brian Reavis](http://brianreavis.github.io/selectize.js/)
|
|
41
41
|
|
42
42
|
| Version | Notes |
|
43
43
|
| -------:| ----------------------------------------------------------- |
|
44
|
+
| 0.7.7 | Update to v0.7.7 of selectize.js |
|
44
45
|
| 0.7.6 | Update to v0.7.6 of selectize.js |
|
45
46
|
| 0.7.5 | Update to v0.7.5 of selectize.js |
|
46
47
|
| 0.7.4 | Update to v0.7.4 of selectize.js |
|
@@ -470,7 +470,7 @@
|
|
470
470
|
}));
|
471
471
|
|
472
472
|
/**
|
473
|
-
* selectize.js (v0.7.
|
473
|
+
* selectize.js (v0.7.7)
|
474
474
|
* Copyright (c) 2013 Brian Reavis & contributors
|
475
475
|
*
|
476
476
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
|
@@ -628,17 +628,6 @@
|
|
628
628
|
.replace(/"/g, '"');
|
629
629
|
};
|
630
630
|
|
631
|
-
/**
|
632
|
-
* Escapes quotation marks with backslashes. Useful
|
633
|
-
* for escaping values for use in CSS attribute selectors.
|
634
|
-
*
|
635
|
-
* @param {string} str
|
636
|
-
* @return {string}
|
637
|
-
*/
|
638
|
-
var escape_quotes = function(str) {
|
639
|
-
return str.replace(/(['"])/g, '\\$1');
|
640
|
-
};
|
641
|
-
|
642
631
|
var hook = {};
|
643
632
|
|
644
633
|
/**
|
@@ -1900,7 +1889,7 @@
|
|
1900
1889
|
*/
|
1901
1890
|
addOptionGroup: function(id, data) {
|
1902
1891
|
this.optgroups[id] = data;
|
1903
|
-
this.trigger('optgroup_add',
|
1892
|
+
this.trigger('optgroup_add', id, data);
|
1904
1893
|
},
|
1905
1894
|
|
1906
1895
|
/**
|
@@ -1998,8 +1987,7 @@
|
|
1998
1987
|
* @returns {object}
|
1999
1988
|
*/
|
2000
1989
|
getOption: function(value) {
|
2001
|
-
value
|
2002
|
-
return value ? this.$dropdown_content.find('[data-selectable]').filter('[data-value="' + escape_quotes(value) + '"]:first') : $();
|
1990
|
+
return this.getElementWithValue(value, this.$dropdown_content.find('[data-selectable]'));
|
2003
1991
|
},
|
2004
1992
|
|
2005
1993
|
/**
|
@@ -2017,6 +2005,28 @@
|
|
2017
2005
|
return index >= 0 && index < $options.length ? $options.eq(index) : $();
|
2018
2006
|
},
|
2019
2007
|
|
2008
|
+
/**
|
2009
|
+
* Finds the first element with a "data-value" attribute
|
2010
|
+
* that matches the given value.
|
2011
|
+
*
|
2012
|
+
* @param {mixed} value
|
2013
|
+
* @param {object} $els
|
2014
|
+
* @return {object}
|
2015
|
+
*/
|
2016
|
+
getElementWithValue: function(value, $els) {
|
2017
|
+
value = hash_key(value);
|
2018
|
+
|
2019
|
+
if (value) {
|
2020
|
+
for (var i = 0, n = $els.length; i < n; i++) {
|
2021
|
+
if ($els[i].getAttribute('data-value') === value) {
|
2022
|
+
return $($els[i]);
|
2023
|
+
}
|
2024
|
+
}
|
2025
|
+
}
|
2026
|
+
|
2027
|
+
return $();
|
2028
|
+
},
|
2029
|
+
|
2020
2030
|
/**
|
2021
2031
|
* Returns the jQuery element of the item
|
2022
2032
|
* matching the given value.
|
@@ -2025,7 +2035,7 @@
|
|
2025
2035
|
* @returns {object}
|
2026
2036
|
*/
|
2027
2037
|
getItem: function(value) {
|
2028
|
-
return this.$control.children(
|
2038
|
+
return this.getElementWithValue(value, this.$control.children());
|
2029
2039
|
},
|
2030
2040
|
|
2031
2041
|
/**
|