Skip to content

Commit a340868

Browse files
authored
Image usability fixes (#101)
* Wait for aux image tag to initialize before refreshing * Listen for aux image changes for open/close project
1 parent f27e1e8 commit a340868

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

webui/src/js/viewModels/domain-design-view.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ function (project, accUtils, utils, ko, i18n, screenUtils, BufferingDataProvider
3030
}));
3131

3232
subscriptions.push(project.image.useAuxImage.observable.subscribe(() => {
33+
this.auxImageConfig(this.computeAuxImageConfig());
3334
// change the primary image tag's help text based on the value of the switch?
3435
const primaryImageTag = document.getElementById('primary-image-tag');
3536
if (primaryImageTag) {
@@ -38,9 +39,12 @@ function (project, accUtils, utils, ko, i18n, screenUtils, BufferingDataProvider
3839
}));
3940

4041
subscriptions.push(project.image.createAuxImage.observable.subscribe(() => {
42+
this.auxImageConfig(this.computeAuxImageConfig());
4143
const auxImageTag = document.getElementById('aux-image-tag');
4244
if (auxImageTag) {
43-
auxImageTag.refresh();
45+
viewHelper.componentReady(auxImageTag).then(() => {
46+
auxImageTag.refresh();
47+
});
4448
}
4549
}));
4650
};

webui/src/js/viewModels/image-design-view-impl.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ define(['utils/wkt-logger', 'utils/screen-utils'],
2626
}));
2727

2828
subscriptions.push(project.image.useAuxImage.observable.subscribe(() => {
29+
this.auxImageConfig(this.computeAuxImageConfig());
2930
document.getElementById('designtabs').refresh();
3031
// change the primary image tag's help text based on the value of the switch?
3132
const primaryImageTag = document.getElementById('primary-image-tag');
@@ -35,6 +36,7 @@ define(['utils/wkt-logger', 'utils/screen-utils'],
3536
}));
3637

3738
subscriptions.push(project.image.createAuxImage.observable.subscribe(() => {
39+
this.auxImageConfig(this.computeAuxImageConfig());
3840
const auxImageTag = document.getElementById('aux-image-tag');
3941
if (auxImageTag) {
4042
auxImageTag.refresh();

0 commit comments

Comments
 (0)