You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by co...@apache.org on 2016/08/21 06:23:38 UTC

zeppelin git commit: [ZEPPELIN-1245] Focus first paragraph after notebook creation

Repository: zeppelin
Updated Branches:
  refs/heads/master 8a29eb283 -> 54d435303


[ZEPPELIN-1245] Focus first paragraph after notebook creation

### What is this PR for?
Once the notebook is created, cursor should focus on the first paragraph

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

### Todos
* [ ] - None

### What is the Jira issue?
 https://issues.apache.org/jira/browse/ZEPPELIN-1245

### How should this be tested?
Once the Zeppelin server is started , Create a new notebook
check if cursor blinks on the first paragraph of the notebook

### Screenshots (if appropriate)

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

Author: rajarajan-g <ra...@imaginea.com>

Closes #1313 from rajarajan-g/ZEPPELIN-1245 and squashes the following commits:

8eb7b32 [rajarajan-g] test case changed to check the default behaviour
85794e9 [rajarajan-g] code modified as per review comments
068cd0b [rajarajan-g] test case modified
e147927 [rajarajan-g] fix for ZEPPELIN-1245


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

Branch: refs/heads/master
Commit: 54d435303c58739de6ca57144f63532637cd291e
Parents: 8a29eb2
Author: rajarajan-g <ra...@imaginea.com>
Authored: Wed Aug 17 20:38:03 2016 +0530
Committer: Damien CORNEAU <co...@gmail.com>
Committed: Sun Aug 21 15:23:27 2016 +0900

----------------------------------------------------------------------
 zeppelin-web/src/app/notebook/notebook.controller.js          | 2 +-
 .../src/app/notebook/paragraph/paragraph.controller.js        | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/54d43530/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 7cc7fd9..f2dce09 100644
--- a/zeppelin-web/src/app/notebook/notebook.controller.js
+++ b/zeppelin-web/src/app/notebook/notebook.controller.js
@@ -68,7 +68,6 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl', function($scope, $ro
   var initNotebook = function() {
     websocketMsgSrv.getNotebook($routeParams.noteId);
     websocketMsgSrv.listRevisionHistory($routeParams.noteId);
-
     var currentRoute = $route.current;
     if (currentRoute) {
       setTimeout(
@@ -333,6 +332,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl', function($scope, $ro
     } else {
       $scope.viewOnly = $scope.note.config.looknfeel === 'report' ? true : false;
     }
+    $scope.note.paragraphs[0].focus = true;
     $rootScope.$broadcast('setLookAndFeel', $scope.note.config.looknfeel);
   };
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/54d43530/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
index dbfe9cf..c2bc8e6 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
@@ -99,7 +99,6 @@ angular.module('zeppelinWebApp').controller('ParagraphCtrl', function($scope, $r
     if (newParagraph.focus) {
       $scope.paragraphFocused = true;
     }
-
     if (!$scope.paragraph.config) {
       $scope.paragraph.config = {};
     }
@@ -558,7 +557,7 @@ angular.module('zeppelinWebApp').controller('ParagraphCtrl', function($scope, $r
       $scope.editor.setTheme('ace/theme/chrome');
       if ($scope.paragraphFocused) {
         $scope.editor.focus();
-        $scope.goToLineEnd();
+        $scope.goToEnd();
       }
 
       autoAdjustEditorHeight(_editor.container.id);
@@ -839,8 +838,8 @@ angular.module('zeppelinWebApp').controller('ParagraphCtrl', function($scope, $r
     return false;
   };
 
-  $scope.goToLineEnd = function() {
-    $scope.editor.navigateLineEnd();
+  $scope.goToEnd = function() {
+    $scope.editor.navigateFileEnd();
   };
 
   $scope.getResultType = function(paragraph) {