Skip to content

Commit 37b33bc

Browse files
committed
右键菜单增加下载目录
1 parent 9c1a965 commit 37b33bc

File tree

4 files changed

+51
-26
lines changed

4 files changed

+51
-26
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ _up0.sh
1313
*-app.asar
1414
.ossutil_checkpoint
1515
ossutil_output
16+
app.asar

app/components/services/auto-upgrade.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ angular.module('web')
114114
that._changeStatus('running');
115115

116116
request
117-
.head(from)
117+
.head({url:from,timeout:10000})
118118
.on('error', function(err) {
119119
console.log(err)
120120
this._changeStatus('failed', err);

app/main/files/_/file-toolbar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
</button>
4343

4444
<button type="button" class="btn btn-default btn-sm" ng-disabled="!sel.has" ng-click="showDownloadDialog()">
45-
<i class="glyphicon glyphicon-cloud-download text-primary"></i>
45+
<i class="fa fa-download text-primary"></i>
4646
<!-- 下载 -->
4747
{{'download'|translate}}
4848
</button>

app/main/files/files.js

Lines changed: 48 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -96,30 +96,54 @@ angular.module('web')
9696

9797

9898
});
99-
$scope.fileSpacerMenuOptions = [
100-
[function(){
101-
return '<i class="glyphicon glyphicon-cloud-upload text-info"></i> ' + T('upload')
102-
}, function ($itemScope, $event) {
103-
showUploadDialog()
104-
}, function(){
105-
return $scope.currentAuthInfo.privilege!='readOnly'
106-
}],
107-
[function(){
108-
return '<i class="glyphicon glyphicon-plus text-success"></i> ' + T('folder.create')
109-
}, function ($itemScope, $event) {
110-
showAddFolder()
111-
}, function(){
112-
return $scope.currentAuthInfo.privilege!='readOnly'
113-
}],
11499

115-
[function(){
116-
return '<i class="fa fa-paste text-primary"></i> ' + T('paste') + ($scope.keepMoveOptions?'('+$scope.keepMoveOptions.items.length+')':'')
117-
}, function ($itemScope, $event) {
118-
showPaste()
119-
}, function(){
120-
return $scope.keepMoveOptions
121-
}]
122-
];
100+
if($scope.isMac){
101+
$scope.fileSpacerMenuOptions = [
102+
[function(){
103+
return '<i class="fa fa-upload text-info"></i> ' + T('upload')
104+
}, function ($itemScope, $event) {
105+
showUploadDialog()
106+
}, function(){
107+
return $scope.currentAuthInfo.privilege!='readOnly'
108+
}]
109+
]
110+
}
111+
else{
112+
$scope.fileSpacerMenuOptions = [
113+
[function(){
114+
return '<i class="fa fa-upload text-info"></i> ' + T('file')
115+
}, function ($itemScope, $event) {
116+
showUploadDialog()
117+
}, function(){
118+
return $scope.currentAuthInfo.privilege!='readOnly'
119+
}],
120+
121+
[function(){
122+
return '<i class="fa fa-upload text-info"></i> ' + T('folder')
123+
}, function ($itemScope, $event) {
124+
showUploadDialog(true)
125+
}, function(){
126+
return $scope.currentAuthInfo.privilege!='readOnly'
127+
}]
128+
]
129+
}
130+
$scope.fileSpacerMenuOptions = $scope.fileSpacerMenuOptions.concat([
131+
[ function(){
132+
return '<i class="glyphicon glyphicon-plus text-success"></i> ' + T('folder.create')
133+
}, function ($itemScope, $event) {
134+
showAddFolder()
135+
}, function(){
136+
return $scope.currentAuthInfo.privilege!='readOnly'
137+
}],
138+
139+
[function(){
140+
return '<i class="fa fa-paste text-primary"></i> ' + T('paste') + ($scope.keepMoveOptions?'('+$scope.keepMoveOptions.items.length+')':'')
141+
}, function ($itemScope, $event) {
142+
showPaste()
143+
}, function(){
144+
return $scope.keepMoveOptions
145+
}]
146+
]);
123147

124148
$scope.fileMenuOptions = function(item, $index){
125149
if($scope.sel.x['i_'+$index]){
@@ -137,7 +161,7 @@ angular.module('web')
137161
return [
138162
[function(){
139163
//download
140-
return '<i class="glyphicon glyphicon-cloud-download text-primary"></i> ' + T('download')
164+
return '<i class="fa fa-download text-primary"></i> ' + T('download')
141165
}, function ($itemScope, $event) {
142166
showDownloadDialog()
143167
}, function(){

0 commit comments

Comments
 (0)