Skip to content

Commit e278e84

Browse files
committed
Clear output correctly
1 parent 479b836 commit e278e84

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

zeppelin-web/src/app/notebook/paragraph/paragraph-results.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@
2525

2626
<div id="p{{paragraph.id}}_text"
2727
class="text"
28-
ng-if="paragraph.result.type == 'TEXT'"></div>
28+
ng-if="getResultType() == 'TEXT'"></div>
2929

3030
<div id="p{{paragraph.id}}_html"
3131
class="resultContained"
32-
ng-if="paragraph.result.type == 'HTML'">
32+
ng-if="getResultType() == 'HTML'">
3333
</div>
3434

3535
<div id="p{{paragraph.id}}_angular"
3636
class="resultContained"
37-
ng-if="paragraph.result.type == 'ANGULAR'">
37+
ng-if="getResultType() == 'ANGULAR'">
3838
</div>
3939

4040
<img id="{{paragraph.id}}_img"
41-
ng-if="paragraph.result.type == 'IMG'"
41+
ng-if="getResultType() == 'IMG'"
4242
ng-src="{{getBase64ImageSrc(paragraph.result.msg)}}">
4343
</img>
4444

zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ angular.module('zeppelinWebApp')
215215
var oldGraphMode = $scope.getGraphMode();
216216
var newGraphMode = $scope.getGraphMode(data.paragraph);
217217
var resultRefreshed = (data.paragraph.dateFinished !== $scope.paragraph.dateFinished);
218+
218219
var statusChanged = (data.paragraph.status !== $scope.paragraph.status);
219220

220221
//console.log("updateParagraph oldData %o, newData %o. type %o -> %o, mode %o -> %o", $scope.paragraph, data, oldType, newType, oldGraphMode, newGraphMode);
@@ -275,6 +276,8 @@ angular.module('zeppelinWebApp')
275276
$scope.renderAngular();
276277
} else if (newType === 'TEXT' && resultRefreshed) {
277278
$scope.renderText();
279+
} else if (newType === 'TEXT' && !$scope.paragraph.result) {
280+
$scope.clearTextOutput();
278281
}
279282

280283
if (statusChanged || resultRefreshed) {

0 commit comments

Comments
 (0)