Repository: zeppelin Updated Branches: refs/heads/master a75aa52b6 -> 4bf0f3a91
[ZEPPELIN-3007] display a note name without any path in the tab title ### What is this PR for? This PR modifies the display of the name of the note. Now, instead of the full path, only the name of the note is displayed. ### What type of PR is it? Improvement ### What is the Jira issue? [ZEPPELIN-3007](https://issues.apache.org/jira/browse/ZEPPELIN-3007) ### Questions: * Does the licenses files need update? no * Is there breaking changes for older versions? no * Does this needs documentation? no Author: tinkoff-dwh <[email protected]> Closes #2698 from tinkoff-dwh/ZEPPELIN-3007 and squashes the following commits: 526e99f1f [tinkoff-dwh] Merge branch 'master' into ZEPPELIN-3007 aefb3f50b [tinkoff-dwh] [ZEPPELIN-3007] change actionBar note name view bdfe474af [tinkoff-dwh] [ZEPPELIN-3007] add ' - Zeppelin' to page title ad53d767d [tinkoff-dwh] [ZEPPELIN-3007] display a note name without any path in the tab title Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/4bf0f3a9 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/4bf0f3a9 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/4bf0f3a9 Branch: refs/heads/master Commit: 4bf0f3a910e01107c00f28e4d138e52c5013f132 Parents: a75aa52 Author: tinkoff-dwh <[email protected]> Authored: Thu Dec 14 09:45:58 2017 +0300 Committer: Lee moon soo <[email protected]> Committed: Tue Dec 19 16:04:54 2017 -0800 ---------------------------------------------------------------------- .../src/app/notebook/notebook-actionBar.html | 11 ++--- .../src/app/notebook/notebook.controller.js | 9 +++- zeppelin-web/src/app/notebook/notebook.css | 47 ++++++++++++++++++++ 3 files changed, 61 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/4bf0f3a9/zeppelin-web/src/app/notebook/notebook-actionBar.html ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/notebook/notebook-actionBar.html b/zeppelin-web/src/app/notebook/notebook-actionBar.html index 0db4ff0..f1d1dd5 100644 --- a/zeppelin-web/src/app/notebook/notebook-actionBar.html +++ b/zeppelin-web/src/app/notebook/notebook-actionBar.html @@ -16,14 +16,15 @@ limitations under the License. <h3> <div style="float: left; width: auto; max-width: 40%" ng-controller="ElasticInputCtrl as input"> - <input type="text" pu-elastic-input class="form-control2" placeholder="New name" style="min-width: 0px; max-width: 95%;" - ng-if="input.showEditor" ng-model="input.value" ng-escape="input.showEditor = false" focus-if="input.showEditor" - ng-blur="updateNoteName(input.value);input.showEditor = false;" ng-enter="updateNoteName(input.value);input.showEditor = false;" /> - <p class="form-control-static2" + <input type="text" pu-elastic-input class="form-control2" placeholder="New name" + style="min-width: 0px; max-width: 85%; margin-left: 2em;" + ng-if="input.showEditor" ng-model="input.value" ng-escape="input.showEditor = false" focus-if="input.showEditor" + ng-blur="updateNoteName(input.value);input.showEditor = false;" ng-enter="updateNoteName(input.value);input.showEditor = false;" /> + <p class="form-control-static2 reverse-ellipsis ellipsis" tooltip-placement="bottom" uib-tooltip={{noteName(note)}} ng-click="input.showEditor = !revisionView; input.value = note.name" - ng-show="!input.showEditor">{{noteName(note)}}</p> + ng-show="!input.showEditor"><span>{{noteName(note)}}</span>></p> </div> <div style="float: left; padding-bottom: 10px"> <span class="labelBtn btn-group"> http://git-wip-us.apache.org/repos/asf/zeppelin/blob/4bf0f3a9/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 1fa6323..b02b74e 100644 --- a/zeppelin-web/src/app/notebook/notebook.controller.js +++ b/zeppelin-web/src/app/notebook/notebook.controller.js @@ -83,7 +83,14 @@ function NotebookCtrl ($scope, $route, $routeParams, $location, $rootScope, let currentSearchParagraph = 0 $scope.$watch('note', function (value) { - $rootScope.pageTitle = value ? value.name : 'Zeppelin' + let title + if (value) { + title = value.name.substr(value.name.lastIndexOf('/') + 1, value.name.length) + title += ' - Zeppelin' + } else { + title = 'Zeppelin' + } + $rootScope.pageTitle = title }, true) $scope.$on('setConnectedStatus', function (event, param) { http://git-wip-us.apache.org/repos/asf/zeppelin/blob/4bf0f3a9/zeppelin-web/src/app/notebook/notebook.css ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/notebook/notebook.css b/zeppelin-web/src/app/notebook/notebook.css index 262ae8e..fe5da5c 100644 --- a/zeppelin-web/src/app/notebook/notebook.css +++ b/zeppelin-web/src/app/notebook/notebook.css @@ -183,6 +183,53 @@ overflow: hidden; } +.ellipsis { + padding-left: 1em; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.reverse-ellipsis { + /* Your move. */ + text-overflow: clip; + position: relative; + background-color: #FFF; +} + +.reverse-ellipsis:before { + content: '\02026'; + position: absolute; + z-index: 1; + left: -1em; + background-color: inherit; + padding-left: 1em; + margin-left: 0.5em; +} + +.reverse-ellipsis span { + min-width: 100%; + position: relative; + display: inline-block; + float: right; + overflow: visible; + background-color: inherit; + text-indent: 0.5em; +} + +.reverse-ellipsis span:before { + content: ''; + position: absolute; + display: inline-block; + width: 1em; + height: 1em; + background-color: inherit; + z-index: 200; + left: -.5em; +} + + + .noOverflow { overflow: hidden !important; }
