Commit e2a02825 authored by Anthony Geourjon's avatar Anthony Geourjon
Browse files

Merge branch 'EDCAMPUS-86-deplacement-fichier-vers-dossier-parent' into 'master'

Fixed 86.

See merge request !33
parents dcd696e3 8bc24775
<div style="width:100%;margin-bottom:5px;" ng-if="filesCtrl.parentFolder || filesCtrl.filePath.length>8"> <div style="width:100%;margin-bottom:5px;" ng-if="filesCtrl.parentFolder || filesCtrl.filePath.length>8">
<div style="margin:20px 0"> <div style="margin:20px 0">
<button class="regular" style="display:inline-block; margin-right:5px;" ng-if="filesCtrl.parentFolder" ng-click="filesCtrl.getFile(filesCtrl.parentFolder);filesCtrl.getFileInfos(filesCtrl.parentFolder)" drop="filesCtrl.parentFolder" dropStyle="columnDrop" title="{{::_labels.parentFolder}}"> <span class="fa fa-arrow-left"></span></button> <button class="regular" style="display:inline-block; margin-right:5px;" ng-if="filesCtrl.parentFolder" ng-click="filesCtrl.getFile(filesCtrl.parentFolder);filesCtrl.getFileInfos(filesCtrl.parentFolder)" drop="filesCtrl" dropStyle="columnDrop" title="{{::_labels.parentFolder}}"> <span class="fa fa-arrow-left"></span></button>
<span ng-if="filesCtrl.parentFolder" class="fa fa-folder"></span> <span ng-if="filesCtrl.parentFolder" class="fa fa-folder"></span>
<span ng-if="filesCtrl.filePath.length>8">... <i class="fa fa-angle-right" aria-hidden="true"></i></span> <span ng-if="filesCtrl.filePath.length>8">... <i class="fa fa-angle-right" aria-hidden="true"></i></span>
<span ng-repeat="file in filesCtrl.filePath track by $index" ng-if='$index>filesCtrl.filePath.length-8'> <span ng-repeat="file in filesCtrl.filePath track by $index" ng-if='$index>filesCtrl.filePath.length-8'>
......
<div style="width:100%;margin-bottom:5px;" ng-if="filesCtrl.parentFolder || filesCtrl.filePath.length>8"> <div style="width:100%;margin-bottom:5px;" ng-if="filesCtrl.parentFolder || filesCtrl.filePath.length>8">
<div style="margin:20px 0"> <div style="margin:20px 0">
<button class="regular" style="display:inline-block; margin-right:5px;" ng-if="filesCtrl.parentFolder" ng-click="filesCtrl.getFile(filesCtrl.parentFolder);filesCtrl.getFileInfos(filesCtrl.parentFolder)" drop="filesCtrl.parentFolder" dropStyle="columnDrop" title="{{::_labels.parentFolder}}"> <span class="fa fa-arrow-left"></span></button> <button class="regular" style="display:inline-block; margin-right:5px;" ng-if="filesCtrl.parentFolder" ng-click="filesCtrl.getFile(filesCtrl.parentFolder);filesCtrl.getFileInfos(filesCtrl.parentFolder)" drop="filesCtrl" dropStyle="columnDrop" title="{{::_labels.parentFolder}}"> <span class="fa fa-arrow-left"></span></button>
<span ng-if="filesCtrl.parentFolder" class="fa fa-folder"></span> <span ng-if="filesCtrl.parentFolder" class="fa fa-folder"></span>
<span ng-if="filesCtrl.filePath.length>8">... <i class="fa fa-angle-right" aria-hidden="true"></i></span> <span ng-if="filesCtrl.filePath.length>8">... <i class="fa fa-angle-right" aria-hidden="true"></i></span>
<span ng-repeat="file in filesCtrl.filePath track by $index" ng-if='$index>filesCtrl.filePath.length-8'> <span ng-repeat="file in filesCtrl.filePath track by $index" ng-if='$index>filesCtrl.filePath.length-8'>
......
...@@ -568,7 +568,7 @@ root.controller('FileOverviewCtrl', ['$scope', '$stateParams','$http','$dropList ...@@ -568,7 +568,7 @@ root.controller('FileOverviewCtrl', ['$scope', '$stateParams','$http','$dropList
filesCtrl.moveFile = function(fileId,newParentId){ filesCtrl.moveFile = function(fileId,newParentId){
var session = $scope._getSession(); var session = $scope._getSession();
if(!fileId) fileId = filesCtrl.selectedFile.id; if(!fileId) fileId = filesCtrl.selectedFile.id;
if(!newParentId) newParentId = filesCtrl.foldersTreeSelectedElement.id; if(!newParentId && newParentId != 0) newParentId = filesCtrl.foldersTreeSelectedElement.id;
$fileFactory.move_file(fileId,newParentId,$scope._getProject(),function(data){ $fileFactory.move_file(fileId,newParentId,$scope._getProject(),function(data){
if(data.status == "success"){ if(data.status == "success"){
var id; var id;
...@@ -617,6 +617,7 @@ root.controller('FileOverviewCtrl', ['$scope', '$stateParams','$http','$dropList ...@@ -617,6 +617,7 @@ root.controller('FileOverviewCtrl', ['$scope', '$stateParams','$http','$dropList
} }
$scope.$on('dropEvent', function(evt, dragged, dropped) { $scope.$on('dropEvent', function(evt, dragged, dropped) {
if(dropped == filesCtrl) dropped = dropped.parentFolder;
filesCtrl.moveFile(dragged.id,dropped.id); filesCtrl.moveFile(dragged.id,dropped.id);
}); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment