mirror of
https://github.com/nasa/openmct.git
synced 2025-06-12 20:28:14 +00:00
[Representation] Begin integration
...of templateLinker into mct-representation. Not working currently due to prevalence of mct-representation instances with transcluding directives (hitting a multiple transclusion error.)
This commit is contained in:
@ -63,6 +63,7 @@ define(
|
||||
TemplateLinker.prototype.link = function (scope, element, transclude) {
|
||||
var originalElement = element,
|
||||
activeElement = element,
|
||||
activeTemplateUrl,
|
||||
self = this;
|
||||
|
||||
function removeElement() {
|
||||
@ -91,13 +92,18 @@ define(
|
||||
}
|
||||
}
|
||||
|
||||
return function (templateUrl) {
|
||||
if (templateUrl) {
|
||||
self.load(templateUrl).then(applyTemplate);
|
||||
} else {
|
||||
removeElement();
|
||||
function changeTemplate(templateUrl) {
|
||||
if (templateUrl !== activeTemplateUrl) {
|
||||
if (templateUrl) {
|
||||
self.load(templateUrl).then(applyTemplate);
|
||||
} else {
|
||||
removeElement();
|
||||
}
|
||||
activeTemplateUrl = templateUrl;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return changeTemplate;
|
||||
};
|
||||
|
||||
return TemplateLinker;
|
||||
|
Reference in New Issue
Block a user