Created
October 29, 2015 20:50
-
-
Save TylerThompson/cc5da9ced7da11ec7134 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
String transversePage(Event event, String attribute){ | |
Element findElm = ((event.target) as Element); | |
String name; | |
if(findElm.getAttribute('$attribute') != null){ | |
name = findElm.getAttribute('$attribute'); | |
} else { | |
for(int i = 0; i<=findElm.children.length;i++) { | |
if (findElm != null) { | |
if (findElm.children.length != i) { | |
if (findElm.children[i] != null) { | |
if (findElm.children[i].getAttribute('$attribute') != null) { | |
name = findElm.children[i].getAttribute('$attribute'); | |
break; | |
} | |
} | |
} | |
} | |
} | |
} | |
return name; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It checks the element that was clicked, returns if the target attribute was found on clicked element or scales down the children of whatever was clicked and returns the attribute.