Skip to content

Commit

Permalink
[MINOR] fix: Validate before setting focus to paragraphs
Browse files Browse the repository at this point in the history
### What is this PR for?

Fixed fragile code in notebook.controller.js. This code causes loading errors as u can see the screenshot above. Especially in different loading system (e.g es6 import, require, webpack)

### What type of PR is it?
[Bug Fix]

### Todos

Nothing

### What is the Jira issue?

MINOR issue

### How should this be tested?

It's trivial.

### Screenshots (if appropriate)

<img width="1440" alt="focus" src="https://cloud.githubusercontent.com/assets/4968473/21457488/fe1de3e0-c972-11e6-87f9-309c576e4421.png">

### Questions:
* Does the licenses files need update? - NO
* Is there breaking changes for older versions? - NO
* Does this needs documentation? - NO

Author: 1ambda <1amb4a@gmail.com>

Closes #1802 from 1ambda/fix/validate-before-setting-focus and squashes the following commits:

720e891 [1ambda] fix: Fragile code in notebook.controller.js
  • Loading branch information
1ambda authored and Leemoonsoo committed Dec 27, 2016
1 parent 93c2dae commit 78425c4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion zeppelin-web/src/app/notebook/notebook.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,9 @@
} else {
$scope.viewOnly = $scope.note.config.looknfeel === 'report' ? true : false;
}
$scope.note.paragraphs[0].focus = true;
if ($scope.note.paragraphs && $scope.note.paragraphs[0]) {
$scope.note.paragraphs[0].focus = true;
}
$rootScope.$broadcast('setLookAndFeel', $scope.note.config.looknfeel);
};

Expand Down

0 comments on commit 78425c4

Please sign in to comment.