Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AlexandreBonaventure/adead49ed02af9b1589ed3454fbe30c0 to your computer and use it in GitHub Desktop.
Save AlexandreBonaventure/adead49ed02af9b1589ed3454fbe30c0 to your computer and use it in GitHub Desktop.
[HYPE] getSymbolInstance
function getSymbolInstanceForElement(hypeDocument, element, event) {
var symbolInstance = null;
var parentSymbolElement = element.parentNode;
while (symbolInstance == null && parentSymbolElement != null) {
symbolInstance = hypeDocument.getSymbolInstanceById(parentSymbolElement.id);
parentSymbolElement = parentSymbolElement.parentNode;
}
console.log(symbolInstance);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment