Skip to content

Instantly share code, notes, and snippets.

@rokinroj
Created April 3, 2023 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rokinroj/e5ad4ae26ef951d217961270ff724111 to your computer and use it in GitHub Desktop.
Save rokinroj/e5ad4ae26ef951d217961270ff724111 to your computer and use it in GitHub Desktop.
Get Active Nested Content Element
function getActiveFeature() {
let editorScope = $scope.$parent;
do {
editorScope = editorScope.$parent;
} while (!isCurrentNode(editorScope));
this.editorScope = editorScope;
return editorScope;
}
function isCurrentNode(editorScope) {
if (editorScope.vm && editorScope.vm.hasOwnProperty('currentNode')) {
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment