mirror of
https://github.com/nasa/openmct.git
synced 2025-02-21 01:42:31 +00:00
[Representation] Rebuild scopes on every change
Create new scopes on every changeTemplate request, even if the same template is being viewed; presume that we want a new instance of the same template. Avoids scope reuse for cases such as switching from a plot of one object to a plot of another object.
This commit is contained in:
parent
a45dfc3822
commit
04594ea536
@ -131,22 +131,20 @@ define(
|
||||
}
|
||||
|
||||
function changeTemplate(templateUrl) {
|
||||
if (templateUrl !== activeTemplateUrl) {
|
||||
if (templateUrl) {
|
||||
addElement();
|
||||
self.load(templateUrl).then(function (template) {
|
||||
// Avoid race conditions
|
||||
if (templateUrl === activeTemplateUrl) {
|
||||
populateElement(template);
|
||||
}
|
||||
}, function () {
|
||||
badTemplate(templateUrl);
|
||||
});
|
||||
} else {
|
||||
removeElement();
|
||||
}
|
||||
activeTemplateUrl = templateUrl;
|
||||
if (templateUrl) {
|
||||
addElement();
|
||||
self.load(templateUrl).then(function (template) {
|
||||
// Avoid race conditions
|
||||
if (templateUrl === activeTemplateUrl) {
|
||||
populateElement(template);
|
||||
}
|
||||
}, function () {
|
||||
badTemplate(templateUrl);
|
||||
});
|
||||
} else {
|
||||
removeElement();
|
||||
}
|
||||
activeTemplateUrl = templateUrl;
|
||||
}
|
||||
|
||||
if (templateUrl) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user