Allowing sections to work outside components

This commit is contained in:
Bruno Alves de Faria committed 2017-03-21 10:16:46 -03:00
1 parent dd745e3f65
commit 2a5699a5b7
3 files changed
+41 -21

No files matched your search

+11
View File
@@ -40,3 +40,14 @@ OHIF.blaze.getParentComponent = (view, property='_component') => {
}
}
};
// Search for the parent template of the given view
OHIF.blaze.getParentTemplateView = view => {
let currentView = view;
while (currentView) {
currentView = currentView.originalParentView || currentView.parentView;
if (currentView.name.indexOf('Template.') > -1) {
return currentView;
}
}
};