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 2017/04/28 09:59:25 UTC

zeppelin git commit: [ZEPPELIN-2448] Fix paragraph navigation issue

Repository: zeppelin
Updated Branches:
  refs/heads/master a593a8b35 -> d82f42def


[ZEPPELIN-2448] Fix paragraph navigation issue

### What is this PR for?
* Keyboard events are broadcasted to components in lower tree
* Focus was getting transferred to the lower paragraphs, causing a chaining effect
* Making emit synchronous fixes the problem

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

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

### How should this be tested?
* Open a notebook with three or more paragraphs (A, B, C, D) one below the other
* Hide editor in B and C
* Try to navigate A to D
* The focus is passed through all four paragraphs

### 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: sravan <sr...@gmail.com>

Closes #2290 from sravan-s/ZEPPELIN-2448 and squashes the following commits:

a01ba7c [sravan] Fix paragraph navigation issue


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

Branch: refs/heads/master
Commit: d82f42def4bfd659155ff66ce1d087e3c076a501
Parents: a593a8b
Author: sravan <sr...@gmail.com>
Authored: Wed Apr 26 20:47:45 2017 +0900
Committer: Lee moon soo <mo...@apache.org>
Committed: Fri Apr 28 02:59:21 2017 -0700

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


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/d82f42de/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 1a92176..3cb8902 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
@@ -1331,7 +1331,8 @@ function ParagraphCtrl ($scope, $rootScope, $route, $window, $routeParams, $loca
         $scope.$emit('moveFocusToPreviousParagraph', paragraphId)
       } else if (editorHide && (keyCode === 40 || (keyCode === 78 && keyEvent.ctrlKey && !keyEvent.altKey))) { // down
         // move focus to next paragraph
-        $scope.$emit('moveFocusToNextParagraph', paragraphId)
+        // $timeout stops chaining effect of focus propogation
+        $timeout(() => $scope.$emit('moveFocusToNextParagraph', paragraphId))
       } else if (keyEvent.shiftKey && keyCode === 13) { // Shift + Enter
         $scope.runParagraphFromShortcut($scope.getEditorValue())
       } else if (keyEvent.ctrlKey && keyEvent.altKey && keyCode === 67) { // Ctrl + Alt + c