[ZEPPELIN-2365] button to create note into folder

This commit is contained in:
Tinkoff DWH 2017-04-06 10:39:02 +05:00
parent 61b7162fb8
commit 0fe290edbf
3 changed files with 16 additions and 7 deletions

View file

@ -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>

View file

@ -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() {

View file

@ -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) {