[FIX] tour.js: introduce common properties selector

Since jquery 1.9, attr selector only matches attributes (the behavior was not
consistent before, sometimes it returned the properties [0]) and tour.js was
relying on those inconsistencies. This commit introduce common properties
selector to allow matching properties during a tour.

[0] http://jquery.com/upgrade-guide/1.9/#attr-versus-prop-
This commit is contained in:
Simon Lejeune
2014-12-19 17:49:12 +01:00
parent 79f246ba1e
commit f017a9fe2b
+10 -1
View File
@@ -41,7 +41,16 @@ $.extend($.expr[':'],{
var regreg = /^\/((?:\\\/|[^\/])+)\/([mig]{0,3})$/,
reg = regreg.exec(m[3]);
return reg ? new RegExp(reg[1], reg[2]).test($.trim(a.innerHTML)) : false;
}
},
propChecked: function(element, index, matches) {
return $(element).prop("checked") === true;
},
propSelected: function(element, index, matches) {
return $(element).prop("selected") === true;
},
propValue: function(element, index, matches) {
return $(element).prop("value") === matches[3];
},
});
$.ajaxSetup({
beforeSend:function(){