Skip to content

Instantly share code, notes, and snippets.

@lsmith
Forked from sdesai/gist:272644
Created January 9, 2010 05:51
Show Gist options
  • Save lsmith/272745 to your computer and use it in GitHub Desktop.
Save lsmith/272745 to your computer and use it in GitHub Desktop.
var CLASS_NAME = "className",
BOUNDING_BOX = "boundingBox",
SKIN_PREFIX = "yui-skin-",
SKIN_REGEXP = new RegExp("(?:^|\\s)" + SKIN_PREFIX + "(\S+)");
...
getActiveSkin : function() {
var match;
this.get(BOUNDING_BOX).ancestor(
function(n) {
return n.get(CLASS_NAME).match(SKIN_REGEXP);
}
);
return (match && match[1] || null);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment