From f017a9fe2b31840fdda4d10eba0225c7ca5fe27d Mon Sep 17 00:00:00 2001 From: Simon Lejeune Date: Mon, 8 Dec 2014 18:38:09 +0100 Subject: [PATCH] [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- --- addons/web/static/src/js/tour.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/tour.js b/addons/web/static/src/js/tour.js index 6813a421cb7..02cfadcb383 100644 --- a/addons/web/static/src/js/tour.js +++ b/addons/web/static/src/js/tour.js @@ -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(){