mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
[ZEPPELIN-2365] button to create note into folder
This commit is contained in:
parent
61b7162fb8
commit
0fe290edbf
3 changed files with 16 additions and 7 deletions
|
|
@ -59,8 +59,16 @@ limitations under the License.
|
|||
<i style="font-size: 10px;" ng-class="node.hidden ? 'icon-folder' : 'icon-folder-alt'"></i> {{getNoteName(node)}}
|
||||
</a>
|
||||
<a ng-if="!node.isTrash" style="text-decoration: none;">
|
||||
<i style="margin-left: 10px;"
|
||||
class="fa fa-pencil notebook-list-btn" ng-show="showFolderButton" ng-click="renameFolder(node)"
|
||||
<a href="" data-toggle="modal" data-target="#noteNameModal" style="text-decoration: none;"
|
||||
ng-controller="NotenameCtrl as notenamectrl" ng-click="notenamectrl.getInterpreterSettings()" data-path="{{node.id}}">
|
||||
<i style="margin-left: 10px;"
|
||||
class="fa fa-plus notebook-list-btn" ng-show="showFolderButton"
|
||||
tooltip-placement="bottom" tooltip="Create new note">
|
||||
</i>
|
||||
</a>
|
||||
</a>
|
||||
<a ng-if="!node.isTrash" style="text-decoration: none;">
|
||||
<i class="fa fa-pencil notebook-list-btn" ng-show="showFolderButton" ng-click="renameFolder(node)"
|
||||
tooltip-placement="bottom" tooltip="Rename folder">
|
||||
</i>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -44,14 +44,14 @@ function NotenameCtrl($scope, noteListDataFactory, $routeParams, websocketMsgSrv
|
|||
vm.createNote();
|
||||
};
|
||||
|
||||
vm.preVisible = function(clone, sourceNoteName) {
|
||||
vm.preVisible = function(clone, sourceNoteName, path) {
|
||||
vm.clone = clone;
|
||||
vm.sourceNoteName = sourceNoteName;
|
||||
$scope.note.notename = vm.clone ? vm.cloneNoteName() : vm.newNoteName();
|
||||
$scope.note.notename = vm.clone ? vm.cloneNoteName() : vm.newNoteName(path);
|
||||
$scope.$apply();
|
||||
};
|
||||
|
||||
vm.newNoteName = function() {
|
||||
vm.newNoteName = function(path) {
|
||||
var newCount = 1;
|
||||
angular.forEach(vm.notes.flatList, function(noteName) {
|
||||
noteName = noteName.name;
|
||||
|
|
@ -62,7 +62,7 @@ function NotenameCtrl($scope, noteListDataFactory, $routeParams, websocketMsgSrv
|
|||
}
|
||||
}
|
||||
});
|
||||
return 'Untitled Note ' + newCount;
|
||||
return (path ? path + '/' : '') +'Untitled Note ' + newCount;
|
||||
};
|
||||
|
||||
vm.cloneNoteName = function() {
|
||||
|
|
|
|||
|
|
@ -30,8 +30,9 @@ function modalvisible() {
|
|||
var relatedTarget = angular.element(e.relatedTarget);
|
||||
var clone = relatedTarget.data('clone');
|
||||
var sourceNoteName = relatedTarget.data('source-note-name');
|
||||
var path = relatedTarget.data('path');
|
||||
var cloneNote = clone ? true : false;
|
||||
previsibleMethod()(cloneNote, sourceNoteName);
|
||||
previsibleMethod()(cloneNote, sourceNoteName, path);
|
||||
});
|
||||
element.on('shown.bs.modal', function(e) {
|
||||
if (scope.targetinput) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue