Created
November 10, 2016 19:20
-
-
Save sz332/893140d1da9ea69c3144a7fd54ee22f8 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
Polymer outside click element | |
window.addEventListener((e) { | |
var target = event.target; | |
while(target != this && target != document.body) { | |
target = Polymer.dom(target).node.domHost.parentNode; | |
// might need some additional steps to get the parent from inside custom elements | |
// don't know by heart | |
} | |
if(target == this) { | |
// inside element | |
} else { | |
// outside element | |
} | |
}); | |
olymer.dom(target).node.parentElement |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment