diff --git a/thirdparty/behaviour/behaviour.js b/thirdparty/behaviour/behaviour.js index 6b2246b52..96a82c002 100644 --- a/thirdparty/behaviour/behaviour.js +++ b/thirdparty/behaviour/behaviour.js @@ -368,6 +368,16 @@ document.getElementsBySelector = function(selector, parentNode) { return new Array(); } + // currentContext limitation: for "body.class #Something" selectors. + var foundInContext = false; + for (var h = 0; h < currentContext.length; h++) { + if(currentContext[i] == document || hasAncestor(element, currentContext[i])) { + foundInContext = true; + } + } + if(!foundInContext) return new Array(); + + // Set currentContext to contain just this element currentContext = new Array(element);