You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mo...@apache.org on 2016/12/27 15:26:31 UTC

zeppelin git commit: [MINOR] fix: Validate before setting focus to paragraphs

Repository: zeppelin
Updated Branches:
  refs/heads/master 93c2dae9e -> 78425c4b2


[MINOR] fix: Validate before setting focus to paragraphs

### 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 <1a...@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


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/78425c4b
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/78425c4b
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/78425c4b

Branch: refs/heads/master
Commit: 78425c4b28d77bb43a57ff427720f1f74eba6fb8
Parents: 93c2dae
Author: 1ambda <1a...@gmail.com>
Authored: Sat Dec 24 00:48:22 2016 +0900
Committer: Lee moon soo <mo...@apache.org>
Committed: Tue Dec 27 07:26:26 2016 -0800

----------------------------------------------------------------------
 zeppelin-web/src/app/notebook/notebook.controller.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/78425c4b/zeppelin-web/src/app/notebook/notebook.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/notebook.controller.js b/zeppelin-web/src/app/notebook/notebook.controller.js
index a5cd83e..cbed858 100644
--- a/zeppelin-web/src/app/notebook/notebook.controller.js
+++ b/zeppelin-web/src/app/notebook/notebook.controller.js
@@ -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);
     };