vendor/assets/javascripts/jquery.role.js in role-rails-1.0.1 vs vendor/assets/javascripts/jquery.role.js in role-rails-1.1.0
- old
+ new
@@ -1,15 +1,15 @@
-// Role.js, jQuery adapter v1.0.1 ~ https://github.com/kossnocorp/role
+// Role.js, jQuery adapter v1.1.0 ~ https://github.com/kossnocorp/role
(function($) {
var matchesSelectorOrigin, type;
if ($ == null) $ = jQuery;
$.expr.match['ROLE'] = /@((?:[\w\u00c0-\uFFFF\-]|\\.)+)/;
$.expr.preFilter['ROLE'] = function(match) {
return ' ' + match[1] + ' ';
};
$.expr.filter['ROLE'] = function(el, match) {
- return (" " + (el.getAttribute('role')) + " ").indexOf(match) !== -1;
+ return (el.getAttribute != null) && (" " + (el.getAttribute('role')) + " ").indexOf(match) !== -1;
};
for (type in $.expr.match) {
$.expr.match[type] = new RegExp($.expr.match[type].source + /(?![^\[]*\])(?![^\(]*\))/.source);
$.expr.leftMatch[type] = new RegExp(/(^(?:.|\r|\n)*?)/.source + $.expr.match[type].source.replace(/\\(\d+)/g, function(all, num) {
return "\\" + (num - 0 + 1);