Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Slick update

  • Loading branch information...
commit 42822872b49c3d672fe09fe47467797a40bc32de 1 parent d750a67
Christoph Pojer cpojer authored
Showing with 21 additions and 9 deletions.
  1. +21 −9 Source/Slick/Slick.Finder.js
30 Source/Slick/Slick.Finder.js
View
@@ -329,17 +329,28 @@ local.search = function(context, expression, append, first){
/*<query-selector-override>*/
querySelector: if (context.querySelectorAll) {
- if (!this.isHTMLDocument || this.brokenMixedCaseQSA || qsaFailExpCache[expression] ||
- (this.brokenCheckedQSA && expression.indexOf(':checked') > -1) ||
- (this.brokenEmptyAttributeQSA && reEmptyAttribute.test(expression)) || Slick.disableQSA) break querySelector;
-
- var _expression = expression;
+ if (!this.isHTMLDocument
+ || qsaFailExpCache[expression]
+ //TODO: only skip when expression is actually mixed case
+ || this.brokenMixedCaseQSA
+ || (this.brokenCheckedQSA && expression.indexOf(':checked') > -1)
+ || (this.brokenEmptyAttributeQSA && reEmptyAttribute.test(expression))
+ || (!contextIsDocument //Abort when !contextIsDocument and...
+ // there are multiple expressions in the selector
+ // since we currently only fix non-document rooted QSA for single expression selectors
+ && expression.indexOf(',') > -1
+ )
+ || Slick.disableQSA
+ ) break querySelector;
+
+ var _expression = expression, _context = context;
if (!contextIsDocument){
// non-document rooted QSA
// credits to Andrew Dupont
- var currentId = context.getAttribute('id'), slickid = 'slickid__';
- context.setAttribute('id', slickid);
+ var currentId = _context.getAttribute('id'), slickid = 'slickid__';
+ _context.setAttribute('id', slickid);
_expression = '#' + slickid + ' ' + _expression;
+ context = _context.parentNode;
}
try {
@@ -350,8 +361,9 @@ local.search = function(context, expression, append, first){
break querySelector;
} finally {
if (!contextIsDocument){
- if (currentId) context.setAttribute('id', currentId);
- else context.removeAttribute('id');
+ if (currentId) _context.setAttribute('id', currentId);
+ else _context.removeAttribute('id');
+ context = _context;
}
}

4 comments on commit 4282287

Thomas Aylott

When are we going to make this a submodule?

Olmo Maldonado
Owner
Jan Kassens
Collaborator

++

André Fiedler

Git submodules are from hell

+1 for repo: /Slick

Please sign in to comment.
Something went wrong with that request. Please try again.