Repository: zeppelin Updated Branches: refs/heads/branch-0.7 f0ef74b11 -> 3179e4332
[ZEPPELIN-2112] Disable keyboard shortcut in "Link this paragraph" URL on 0.7.0 version ### What is this PR for? If using a `Link this paragraph`, new window works the keyboard shortcut on the 0.7.0 version. So that this is the keyboard shortcut should not work in `Link this paragraph` URL on branch-0.7. Also, I remove border and margin of paragraph in new window of "Link this paragraph". this would be more useful. This issue is related to [ZEPPELIN-1808](https://issues.apache.org/jira/browse/ZEPPELIN-1808) and this [comment](https://github.com/apache/zeppelin/pull/1983#issuecomment-279395050) suggestion by Leemoonsoo. ### What type of PR is it? [Bug Fix | Improvement] ### Todos * [x] - Disable keyboard shortcut in new window of "Link this paragraph" on 0.7.0 version * [x] - Fix layout about border and margin in paragraph website ### What is the Jira issue? * [ZEPPELIN-2112](https://issues.apache.org/jira/browse/ZEPPELIN-2112) ### How should this be tested? 1. Build `branch-0.7` branch and run Zeppelin 2. Click `Link this paragraph` or Use Ctrl+Alt(command)+w in a paragraph. 3. Use some keyboard shortcut in new window which is created by `Link this paragraph`. 4. Check text and title shape of the paragraph such like text, title, graph.. etc. ### Screenshots (if appropriate) [ Before ]  [ After ]  ### 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 #2045 from soralee/0.7-ZEPPELIN-2112_dont_shortcut and squashes the following commits: 27e6d29 [soralee] remove left space 4697b94 [soralee] revort file 31b7551 [soralee] revort file af06b67 [soralee] disable shortcut key in Link this paragraph url Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/3179e433 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/3179e433 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/3179e433 Branch: refs/heads/branch-0.7 Commit: 3179e4332959500585f179ad7075c100eabf4d8a Parents: f0ef74b Author: soralee <sora0...@zepl.com> Authored: Tue Feb 21 13:15:58 2017 +0900 Committer: Lee moon soo <m...@apache.org> Committed: Sun Mar 5 10:35:00 2017 +0900 ---------------------------------------------------------------------- zeppelin-web/src/app/home/home.css | 1 + zeppelin-web/src/app/home/home.html | 2 +- zeppelin-web/src/app/notebook/notebook.controller.js | 11 +++++++++-- zeppelin-web/src/app/notebook/notebook.html | 2 +- zeppelin-web/src/app/notebook/paragraph/paragraph.css | 13 +++++++++++-- 5 files changed, 23 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/3179e433/zeppelin-web/src/app/home/home.css ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/home/home.css b/zeppelin-web/src/app/home/home.css index a0e4a6d..f813ccc 100644 --- a/zeppelin-web/src/app/home/home.css +++ b/zeppelin-web/src/app/home/home.css @@ -28,6 +28,7 @@ body { } .bodyAsIframe { + padding-top: 20px; background: white; } http://git-wip-us.apache.org/repos/asf/zeppelin/blob/3179e433/zeppelin-web/src/app/home/home.html ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/home/home.html b/zeppelin-web/src/app/home/home.html index b86671d..04a85cd 100644 --- a/zeppelin-web/src/app/home/home.html +++ b/zeppelin-web/src/app/home/home.html @@ -82,7 +82,7 @@ limitations under the License. ng-controller="ParagraphCtrl" ng-init="init(currentParagraph, home.note)" ng-class="columnWidthClass(currentParagraph.config.colWidth)" - class="paragraph-col"> + style="margin: 0; padding: 0;"> <div id="{{currentParagraph.id}}_paragraphColumn" ng-if="currentParagraph.results" ng-include src="'app/notebook/paragraph/paragraph.html'" http://git-wip-us.apache.org/repos/asf/zeppelin/blob/3179e433/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 8d42494..63a0130 100644 --- a/zeppelin-web/src/app/notebook/notebook.controller.js +++ b/zeppelin-web/src/app/notebook/notebook.controller.js @@ -993,14 +993,16 @@ 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, note); + $scope.$broadcast('$unBindKeyEvent', $scope.$unBindKeyEvent); $rootScope.$broadcast('setIframe', $scope.asIframe); } - $scope.note = note; initializeLookAndFeel(); //open interpreter binding setting when there're none selected getInterpreterBindings(); @@ -1019,6 +1021,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/3179e433/zeppelin-web/src/app/notebook/notebook.html ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/notebook/notebook.html b/zeppelin-web/src/app/notebook/notebook.html index 35b3dff..9f956d1 100644 --- a/zeppelin-web/src/app/notebook/notebook.html +++ b/zeppelin-web/src/app/notebook/notebook.html @@ -112,7 +112,7 @@ limitations under the License. ng-controller="ParagraphCtrl" ng-init="init(currentParagraph, note)" ng-class="columnWidthClass(currentParagraph.config.colWidth)" - class="paragraph-col"> + style="margin: 0; padding: 0;"> <div class="new-paragraph" ng-click="insertNew('above')" ng-hide="viewOnly || asIframe || revisionView"> <h4 class="plus-sign">+</h4> </div> http://git-wip-us.apache.org/repos/asf/zeppelin/blob/3179e433/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 961a5f0..834bab5 100644 --- a/zeppelin-web/src/app/notebook/paragraph/paragraph.css +++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.css @@ -114,7 +114,7 @@ table.dataTable.table-condensed .sorting_desc:after { .paragraphAsIframe { padding: 0; margin-top: -79px; - margin-left: -10px; + margin-left: 0px; margin-right: -10px; } @@ -146,7 +146,8 @@ table.dataTable.table-condensed .sorting_desc:after { display: block; unicode-bidi: embed; display: block !important; - margin: 0 0 10px!important; + margin-top: 0; + margin-left: 10px; font-size: 12px!important; line-height: 1.42857143!important; word-break: break-all!important; @@ -154,6 +155,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 */