Created
April 22, 2011 03:43
-
-
Save akoppela/935974 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getTarget: function(target, anchor) { | |
if (!target && !(target = this.attributes.target)) return false; | |
var parsed = this.parseTargetSelector(target); | |
var results = []; | |
parsed.each(function(expression) { | |
if (!anchor) anchor = expression.anchor ? expression.anchor.call(this) : (this.document || document.body); | |
if (expression.selector) results.push.apply(results, Slick.search(anchor, expression.selector)); | |
else if (anchor) results.push(anchor) | |
}, this); | |
return results.length > 0 && results.map(function(result) { | |
if (result.localName) { | |
var widget = Element.retrieve(result, 'widget'); | |
if (widget && widget.element == result) return widget | |
} | |
return result; | |
}); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parseTargetSelector: function(selector) { | |
if (selector == 'lightbox') return [selector]; | |
return parseTargetSelector.apply(this, arguments); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment