Skip to content

Commit 2fff6ef

Browse files
Merge branch 'release-5.20.3'
2 parents f4e784d + 198bfb5 commit 2fff6ef

1 file changed

Lines changed: 24 additions & 22 deletions

File tree

src/main/webapp/wise5/authoringTool/node/nodeAuthoringController.ts

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -92,24 +92,24 @@ class NodeAuthoringController {
9292
this.originalNodeCopy = this.UtilService.makeCopyOfJSONObject(this.node);
9393
this.currentNodeCopy = this.UtilService.makeCopyOfJSONObject(this.node);
9494

95-
this.componentShowSubmitButtonValueChangedSubscription =
96-
this.NodeService.componentShowSubmitButtonValueChanged$
97-
.subscribe(({ showSubmitButton }) => {
98-
if (showSubmitButton) {
99-
this.node.showSaveButton = false;
100-
this.node.showSubmitButton = false;
101-
this.ProjectService.turnOnSaveButtonForAllComponents(this.node);
102-
} else {
103-
if (this.ProjectService.doesAnyComponentInNodeShowSubmitButton(this.node.id)) {
95+
this.componentShowSubmitButtonValueChangedSubscription = this.NodeService.componentShowSubmitButtonValueChanged$.subscribe(
96+
({ showSubmitButton }) => {
97+
if (showSubmitButton) {
98+
this.node.showSaveButton = false;
99+
this.node.showSubmitButton = false;
104100
this.ProjectService.turnOnSaveButtonForAllComponents(this.node);
105101
} else {
106-
this.node.showSaveButton = true;
107-
this.node.showSubmitButton = false;
108-
this.ProjectService.turnOffSaveButtonForAllComponents(this.node);
102+
if (this.ProjectService.doesAnyComponentInNodeShowSubmitButton(this.node.id)) {
103+
this.ProjectService.turnOnSaveButtonForAllComponents(this.node);
104+
} else {
105+
this.node.showSaveButton = true;
106+
this.node.showSubmitButton = false;
107+
this.ProjectService.turnOffSaveButtonForAllComponents(this.node);
108+
}
109109
}
110+
this.authoringViewNodeChanged();
110111
}
111-
this.authoringViewNodeChanged();
112-
});
112+
);
113113

114114
const data = {
115115
title: this.ProjectService.getNodePositionAndTitleByNodeId(this.nodeId)
@@ -133,7 +133,7 @@ class NodeAuthoringController {
133133
$onInit() {
134134
this.nodeChangedSubscription = this.ProjectService.nodeChanged$.subscribe((doParseProject) => {
135135
this.authoringViewNodeChanged(doParseProject);
136-
})
136+
});
137137
}
138138

139139
ngOnDestroy() {
@@ -148,9 +148,7 @@ class NodeAuthoringController {
148148
previewStepInNewWindow() {
149149
const data = { constraints: true };
150150
this.saveEvent('stepPreviewed', 'Navigation', data);
151-
window.open(
152-
`${this.ConfigService.getConfigParam('previewProjectURL')}/${this.nodeId}`
153-
);
151+
window.open(`${this.ConfigService.getConfigParam('previewProjectURL')}/${this.nodeId}`);
154152
}
155153

156154
previewStepWithoutConstraintsInNewWindow() {
@@ -602,11 +600,15 @@ class NodeAuthoringController {
602600
showComponentAdvancedAuthoring(component: any) {
603601
this.$mdDialog.show({
604602
templateUrl: 'wise5/authoringTool/components/edit-component-advanced.html',
605-
controller: function($scope: any, $mdDialog: any) {
606-
$scope.close = function() {
607-
$mdDialog.hide();
603+
controller: [
604+
'$scope',
605+
'$mdDialog',
606+
function ($scope: any, $mdDialog: any) {
607+
$scope.close = function () {
608+
$mdDialog.hide();
609+
};
608610
}
609-
},
611+
],
610612
controllerAs: '$ctrl',
611613
bindToController: true,
612614
locals: {

0 commit comments

Comments
 (0)