Skip to content

Commit 7e0ea21

Browse files
committed
some updates
1 parent d29465c commit 7e0ea21

11 files changed

+34
-43
lines changed

dist/angular-filemanager.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-filemanager.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/css/angular-filemanager.css

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ body {
4242
box-shadow: 0 2px 5px 0 rgba(0,0,0,.26);
4343
font-weight: 500;
4444
letter-spacing: .01em;
45-
border: none!important;
45+
border: none;
4646
}
4747

4848
*, *:focus {
@@ -189,9 +189,9 @@ a:hover {
189189
padding-left: 0;
190190
}
191191

192-
.file-tree .file-tree-root > li {
193-
border-left: none!important;
194-
padding-left: 0px!important;
192+
.file-tree ul.nav.nav-sidebar.file-tree-root > li {
193+
border-left: none;
194+
padding-left: 0px;
195195
}
196196

197197
.mr2 {
@@ -202,9 +202,8 @@ a:hover {
202202
margin-right: 5px;
203203
}
204204

205-
.table.table-files td {
206-
/*padding: 3px 8px!important;*/
207-
vertical-align: middle!important;
205+
.table td {
206+
vertical-align: middle;
208207
}
209208

210209
#context-menu {

src/js/controller.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,11 @@
2626
};
2727

2828
$scope.touch = function(item) {
29-
item = (item && item.revert && item) || new Item();
29+
item = item instanceof Item ? item : new Item();
3030
item.revert && item.revert();
3131
$scope.temp = item;
3232
};
3333

34-
$scope.smartRightClick = function(item) {
35-
$scope.touch(item);
36-
};
37-
3834
$scope.smartClick = function(item) {
3935
if (item.isFolder()) {
4036
return $scope.fileNavigator.folderClick(item);
@@ -141,6 +137,7 @@
141137
window.location.search.substr(1).split("&").forEach(function(item) {
142138
if (param === item.split("=")[0]) {
143139
found = item.split("=")[1];
140+
return false;
144141
}
145142
});
146143
return found;

src/js/filenavigator.js

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
});
3333
self.requesting = false;
3434
self.buildTree(path);
35-
3635
if (data.error) {
3736
self.error = data.error;
3837
return typeof error === 'function' && error(data);
@@ -46,22 +45,22 @@
4645

4746
FileNavigator.prototype.buildTree = function(path) {
4847
var self = this;
49-
function recursive(parent, file, path) {
50-
var absName = path ? (path + '/' + file.name) : file.name;
48+
function recursive(parent, item, path) {
49+
var absName = path ? (path + '/' + item.model.name) : item.model.name;
5150
if (parent.name.trim() && path.trim().indexOf(parent.name) !== 0) {
5251
parent.nodes = [];
5352
}
5453
if (parent.name !== path) {
5554
for (var i in parent.nodes) {
56-
recursive(parent.nodes[i], file, path);
55+
recursive(parent.nodes[i], item, path);
5756
}
5857
} else {
5958
for (var e in parent.nodes) {
6059
if (parent.nodes[e].name === absName) {
6160
return;
6261
}
6362
}
64-
parent.nodes.push({name: absName, nodes: []});
63+
parent.nodes.push({item: item, name: absName, nodes: []});
6564
}
6665
parent.nodes = parent.nodes.sort(function(a, b) {
6766
return a.name < b.name ? -1 : a.name === b.name ? 0 : 1;
@@ -71,23 +70,18 @@
7170
!self.history.length && self.history.push({name: path, nodes: []});
7271
for (var o in self.fileList) {
7372
var item = self.fileList[o];
74-
item.isFolder() && recursive(self.history[0], item.model, path);
73+
item.isFolder() && recursive(self.history[0], item, path);
7574
}
7675
};
7776

78-
FileNavigator.prototype.folderClickByName = function(fullPath) {
79-
var self = this;
80-
fullPath = fullPath.replace(/^\/*/g, '').split('/');
81-
self.currentPath = fullPath && fullPath[0] === "" ? [] : fullPath;
82-
self.refresh();
83-
};
84-
8577
FileNavigator.prototype.folderClick = function(item) {
8678
var self = this;
87-
if (item && item.model.type === 'dir') {
88-
self.currentPath.push(item.model.name);
89-
self.refresh();
79+
self.currentPath = [];
80+
if (item && item.isFolder()) {
81+
self.currentPath = item.model.fullPath().split('/').splice(1);
82+
//self.currentPath.push(item.model.name);
9083
}
84+
self.refresh();
9185
};
9286

9387
FileNavigator.prototype.upDir = function() {

src/js/fileuploader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
"Content-Type": undefined
2121
}
2222
}).success(function(data) {
23-
self.inprocess = false;
23+
self.requesting = false;
2424
}).error(function(data) {
25-
self.inprocess = false;
25+
self.requesting = false;
2626
});
2727
};
2828
}]);

src/js/selector-controller.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
(function(angular, $) {
22
"use strict";
33
angular.module('FileManagerApp').controller('ModalFileManagerCtrl', [
4-
'$scope', '$rootScope', 'fileManagerConfig', 'fileNavigator',
5-
function($scope, $rootScope, fileManagerConfig, FileNavigator) {
4+
'$scope', '$rootScope', 'fileNavigator',
5+
function($scope, $rootScope, FileNavigator) {
66

7-
$scope.appName = fileManagerConfig.appName;
87
$scope.orderProp = ['model.type', 'model.name'];
98
$scope.fileNavigator = new FileNavigator();
109

src/templates/main-icons.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="iconset clearfix">
22
<div class="col-120" data-ng-repeat="item in fileNavigator.fileList | filter: query | orderBy: orderProp" data-ng-show="!fileNavigator.requesting && !fileNavigator.error">
3-
<a href="" class="thumbnail text-center" data-ng-click="smartClick(item)" ng-right-click="smartRightClick(item)" title="{{item.model.name}} ({{item.model.sizeKb()}}kb)">
3+
<a href="" class="thumbnail text-center" data-ng-click="smartClick(item)" ng-right-click="touch(item)" title="{{item.model.name}} ({{item.model.sizeKb()}}kb)">
44
<div class="item-icon">
55
<i class="glyphicon glyphicon-folder-open" data-ng-show="item.model.type === 'dir'"></i>
66
<i class="glyphicon glyphicon-file" data-ng-show="item.model.type === 'file'"></i>

src/templates/main-table-modal.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<table class="table table-condensed table-modal-condensed table-hover mb0 table-files">
1+
<table class="table table-condensed table-modal-condensed mb0">
22
<thead>
33
<tr>
44
<th>{{"name" | translate}}</th>
@@ -7,7 +7,7 @@
77
</thead>
88
<tbody class="file-item">
99
<tr data-ng-show="fileNavigator.requesting">
10-
<td colspan="3">
10+
<td colspan="2">
1111
{{"loading" | translate}}...
1212
</td>
1313
</tr>
@@ -20,7 +20,7 @@
2020
</td>
2121
</tr>
2222
<tr data-ng-show="!fileNavigator.requesting && fileNavigator.error">
23-
<td colspan="3">
23+
<td colspan="2">
2424
{{ fileNavigator.error }}
2525
</td>
2626
</tr>
@@ -32,7 +32,9 @@
3232
</a>
3333
</td>
3434
<td class="text-right">
35-
<button class="btn btn-sm btn-default" data-ng-click="select(item, temp)"><i class="glyphicon glyphicon-hand-up"></i> {{"select_this" | translate}}</button>
35+
<button class="btn btn-sm btn-default" data-ng-click="select(item, temp)">
36+
<i class="glyphicon glyphicon-hand-up"></i> {{"select_this" | translate}}
37+
</button>
3638
</td>
3739
</tr>
3840
</tbody>

src/templates/main-table.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</td>
2626
</tr>
2727
<tr data-ng-repeat="item in fileNavigator.fileList | filter: query | orderBy: orderProp" data-ng-show="!fileNavigator.requesting">
28-
<td ng-right-click="smartRightClick(item)">
28+
<td ng-right-click="touch(item)">
2929
<a href="" data-ng-click="smartClick(item)" title="{{item.model.name}} ({{item.model.sizeKb()}}kb)">
3030
<i class="glyphicon glyphicon-folder-close" data-ng-show="item.model.type === 'dir'"></i>
3131
<i class="glyphicon glyphicon-file" data-ng-show="item.model.type === 'file'"></i>

0 commit comments

Comments
 (0)