File manager - Edit - /usr/local/CyberCP/cyberpanel/static/filemanager_app/src/js/controllers/selector-controller.js
Back
(function(angular) { 'use strict'; angular.module('FileManagerApp').controller('ModalFileManagerCtrl', ['$scope', '$rootScope', 'fileNavigator', function($scope, $rootScope, FileNavigator) { $scope.reverse = false; $scope.predicate = ['model.type', 'model.name']; $scope.fileNavigator = new FileNavigator(); $rootScope.selectedModalPath = []; $scope.order = function(predicate) { $scope.reverse = ($scope.predicate[1] === predicate) ? !$scope.reverse : false; $scope.predicate[1] = predicate; }; $scope.select = function(item) { $rootScope.selectedModalPath = item.model.fullPath().split('/').filter(Boolean); $scope.modal('selector', true); }; $scope.selectCurrent = function() { $rootScope.selectedModalPath = $scope.fileNavigator.currentPath; $scope.modal('selector', true); }; $scope.selectedFilesAreChildOfPath = function(item) { var path = item.model.fullPath(); return $scope.temps.find(function(item) { var itemPath = item.model.fullPath(); if (path == itemPath) { return true; } /* if (path.startsWith(itemPath)) { fixme names in same folder like folder-one and folder-one-two at the moment fixed hidding affected folders } */ }); }; $rootScope.openNavigator = function(path) { $scope.fileNavigator.currentPath = path; $scope.fileNavigator.refresh(); $scope.modal('selector'); }; $rootScope.getSelectedPath = function() { var path = $rootScope.selectedModalPath.filter(Boolean); var result = '/' + path.join('/'); if ($scope.singleSelection() && !$scope.singleSelection().isFolder()) { result += '/' + $scope.singleSelection().tempModel.name; } return result.replace(/\/\//, '/'); }; }]); })(angular);
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings