Skip to content

Commit

Permalink
feat: disable person mode btn when running
Browse files Browse the repository at this point in the history
  • Loading branch information
1ambda committed Mar 9, 2017
1 parent 6d72db3 commit 5e0f0b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions zeppelin-web/src/app/notebook/notebook-actionBar.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ <h3>

<button type="button"
class="btn btn-primary btn-xs"
ng-class="isNoteRunning() ? 'disabled' : ''"
ng-if="ticket.principal && ticket.principal !== 'anonymous'"
ng-hide="viewOnly || note.config.personalizedMode !== 'true'"
ng-click="toggleNotePersonalizedMode()"
Expand All @@ -83,6 +84,7 @@ <h3>
</button>
<button type="button"
class="btn btn-default btn-xs"
ng-class="isNoteRunning() ? 'disabled' : ''"
ng-if="ticket.principal && ticket.principal !== 'anonymous'"
ng-hide="viewOnly || note.config.personalizedMode === 'true'"
ng-click="toggleNotePersonalizedMode()"
Expand Down
9 changes: 4 additions & 5 deletions zeppelin-web/src/app/notebook/notebook.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,15 +358,14 @@ function NotebookCtrl($scope, $route, $routeParams, $location, $rootScope,
};

$scope.isNoteRunning = function() {
var running = false;
if (!$scope.note) { return false; }
for (var i = 0; i < $scope.note.paragraphs.length; i++) {
if ($scope.note.paragraphs[i].status === 'PENDING' || $scope.note.paragraphs[i].status === 'RUNNING') {
running = true;
break;
const status = $scope.note.paragraphs[i].status;
if (status === 'PENDING' || status === 'RUNNING') {
return true;
}
}
return running;
return false;
};

$scope.killSaveTimer = function() {
Expand Down

0 comments on commit 5e0f0b0

Please sign in to comment.