Skip to content

Commit 5d7b99b

Browse files
committed
correct scope
1 parent 583a5e3 commit 5d7b99b

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ describe('Controller: NotebookCtrl', function() {
3838
});
3939

4040
let functions = ['getCronOptionNameFromValue', 'removeNote', 'runAllParagraphs', 'saveNote', 'toggleAllEditor',
41-
'showAllEditor', 'hideAllEditor', 'toggleAllTable', 'hideAllTable', 'showAllTable', 'isNoteRunning',
42-
'killSaveTimer', 'startSaveTimer', 'setLookAndFeel', 'setCronScheduler', 'setConfig', 'updateNoteName',
43-
'openSetting', 'closeSetting', 'saveSetting', 'toggleSetting'];
41+
'showAllEditor', 'hideAllEditor', 'toggleAllTable', 'hideAllTable', 'toggleAllNumbering', 'updateParagraphNumbering',
42+
'showAllTable', 'isNoteRunning', 'killSaveTimer', 'startSaveTimer', 'setLookAndFeel', 'setCronScheduler',
43+
'setConfig', 'updateNoteName', 'openSetting', 'closeSetting', 'saveSetting', 'toggleSetting'];
4444

4545
functions.forEach(function(fn) {
4646
it('check for scope functions to be defined : ' + fn, function() {

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,9 @@ function ParagraphCtrl($scope, $rootScope, $route, $window, $routeParams, $locat
155155
noteVarShareService.put($scope.paragraph.id + '_paragraphScope', paragraphScope);
156156

157157
initializeDefault($scope.paragraph.config);
158-
159-
$scope.updateParagraphNumbering();
158+
if ($scope.updateParagraphNumbering) {
159+
$scope.updateParagraphNumbering();
160+
}
160161
};
161162

162163
$scope.$on('noteRunningStatus', function(event, status) {
@@ -180,7 +181,11 @@ function ParagraphCtrl($scope, $rootScope, $route, $window, $routeParams, $locat
180181
}
181182

182183
if (config.numbering === undefined) {
183-
config.numbering = $scope.note.config.numberingToggled;
184+
if ($scope.note) {
185+
config.numbering = $scope.note.config.numberingToggled;
186+
} else {
187+
config.numbering = false;
188+
}
184189
}
185190

186191
for (let idx in forms) {

0 commit comments

Comments
 (0)