Repository: zeppelin
Updated Branches:
  refs/heads/master 9f22db91c -> 0cb0f36ba


[ZEPPELIN-1808] disable shortcut key of window created by link this paragraph

### What is this PR for?
If using a `Link this paragraph`, new window works the keyboard shortcut.
Keyboard shortcut should not work in "Link this paragraph" URL.

### What type of PR is it?
[ Improvement ]

### What is the Jira issue?
[ZEPPELIN-1808](https://issues.apache.org/jira/browse/ZEPPELIN-1808)

### How should this be tested?
1. Click `Link this paragraph` or Use `Ctrl+Alt(command)+w` in a paragraph.
2. Use some keyboard shortcut in new window which is created by `Link this 
paragraph`.
3. Check text and title shape of the paragraph.

### Screenshots (if appropriate)
[ Before ]
* When trying to use keyboard shortcut`(Ctrl+Alt/Command+t)` in paragraph of 
new window.
![1808_b](https://cloud.githubusercontent.com/assets/8110458/22680039/6020a24a-ed49-11e6-9d52-accfa4982252.gif)

* Text and title are misaligned
![1808_b](https://cloud.githubusercontent.com/assets/8110458/22680223/3ac4f090-ed4a-11e6-972d-e863ce81a187.png)

[ After ]
![image](https://cloud.githubusercontent.com/assets/8110458/22680134/dc18169e-ed49-11e6-9190-f5a9ae20c745.png)

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

Author: soralee <sora0...@zepl.com>

Closes #1983 from soralee/ZEPPELIN-1808_dont_shortcut and squashes the 
following commits:

df5ac18 [soralee] [ZEPPELIN-1808] disable shortcut key of window created by 
link this paragraph


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

Branch: refs/heads/master
Commit: 0cb0f36baf3f46377f680b00a36b08acd40ce246
Parents: 9f22db9
Author: soralee <sora0...@zepl.com>
Authored: Tue Feb 7 02:15:14 2017 +0900
Committer: Jongyoul Lee <jongy...@apache.org>
Committed: Tue Mar 14 16:03:36 2017 +0900

----------------------------------------------------------------------
 zeppelin-web/src/app/notebook/notebook.controller.js  | 14 ++++++++++++--
 zeppelin-web/src/app/notebook/paragraph/paragraph.css | 12 ++++++++++--
 2 files changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0cb0f36b/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 6448d33..7846725 100644
--- a/zeppelin-web/src/app/notebook/notebook.controller.js
+++ b/zeppelin-web/src/app/notebook/notebook.controller.js
@@ -985,15 +985,20 @@ function NotebookCtrl($scope, $route, $routeParams, 
$location, $rootScope,
       $location.path('/');
     }
 
+    $scope.note = note;
+
     $scope.paragraphUrl = $routeParams.paragraphId;
     $scope.asIframe = $routeParams.asIframe;
     if ($scope.paragraphUrl) {
-      note = cleanParagraphExcept($scope.paragraphUrl, note);
+      $scope.note = cleanParagraphExcept($scope.paragraphUrl, $scope.note);
+      $scope.$broadcast('$unBindKeyEvent', $scope.$unBindKeyEvent);
       $rootScope.$broadcast('setIframe', $scope.asIframe);
+      initializeLookAndFeel();
+      return;
     }
 
-    $scope.note = note;
     initializeLookAndFeel();
+
     //open interpreter binding setting when there're none selected
     getInterpreterBindings();
     getPermissions();
@@ -1011,6 +1016,11 @@ function NotebookCtrl($scope, $route, $routeParams, 
$location, $rootScope,
     document.removeEventListener('keydown', $scope.keyboardShortcut);
   });
 
+  $scope.$on('$unBindKeyEvent', function() {
+    document.removeEventListener('click', $scope.focusParagraphOnClick);
+    document.removeEventListener('keydown', $scope.keyboardShortcut);
+  });
+
   angular.element(window).bind('resize', function() {
     const actionbarHeight = 
document.getElementById('actionbar').lastElementChild.clientHeight;
     angular.element(document.getElementById('content')).css('padding-top', 
actionbarHeight - 20);

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/0cb0f36b/zeppelin-web/src/app/notebook/paragraph/paragraph.css
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.css 
b/zeppelin-web/src/app/notebook/paragraph/paragraph.css
index 89fab03..1c5e560 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.css
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.css
@@ -118,7 +118,7 @@ table.dataTable.table-condensed .sorting_desc:after {
 .paragraphAsIframe {
   padding: 0;
   margin-top: -79px;
-  margin-left: -10px;
+  margin-left: 0px;
   margin-right: -10px;
 }
 
@@ -150,7 +150,7 @@ table.dataTable.table-condensed .sorting_desc:after {
   display: block;
   unicode-bidi: embed;
   display: block !important;
-  margin: 0 0 10px!important;
+  margin: 0 10px 5px!important;
   font-size: 12px!important;
   line-height: 1.42857143!important;
   word-break: break-all!important;
@@ -158,6 +158,14 @@ table.dataTable.table-condensed .sorting_desc:after {
   font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 
'source-code-pro', monospace;
 }
 
+.paragraphAsIframe .title {
+  width: 80%;
+  font-weight: bold;
+  font-family: 'Roboto', sans-serif;
+  font-size: 17px !important;
+  margin: 0 10px !important;
+}
+
 /*
   Paragraph Controls CSS
 */

Reply via email to