aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/admin.js8
-rw-r--r--apps/files/js/fileactions.js8
-rw-r--r--apps/files/js/filelist.js20
-rw-r--r--apps/files/js/files.js8
-rw-r--r--apps/files/js/navigation.js4
5 files changed, 23 insertions, 25 deletions
diff --git a/apps/files/js/admin.js b/apps/files/js/admin.js
index 842b73c0cae..dcfec824cfe 100644
--- a/apps/files/js/admin.js
+++ b/apps/files/js/admin.js
@@ -25,12 +25,4 @@ $(document).ready(function() {
// To get rid of onClick()
switchPublicFolder();
});
-
- $('#allowZipDownload').bind('change', function() {
- if($('#allowZipDownload').attr('checked')) {
- $('#maxZipInputSize').removeAttr('disabled');
- } else {
- $('#maxZipInputSize').attr('disabled', 'disabled');
- }
- });
});
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 3df62f37518..de02bf5e730 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -275,14 +275,8 @@
});
this.setDefault('dir', 'Open');
- var downloadScope;
- if ($('#allowZipDownload').val() == 1) {
- downloadScope = 'all';
- } else {
- downloadScope = 'file';
- }
- this.register(downloadScope, 'Download', OC.PERMISSION_READ, function () {
+ this.register('all', 'Download', OC.PERMISSION_READ, function () {
return OC.imagePath('core', 'actions/download');
}, function (filename, context) {
var dir = context.dir || context.fileList.getCurrentDirectory();
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 68b22207144..4229988b171 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -613,7 +613,7 @@
// size column
if (typeof(fileData.size) !== 'undefined' && fileData.size >= 0) {
- simpleSize = humanFileSize(parseInt(fileData.size, 10));
+ simpleSize = humanFileSize(parseInt(fileData.size, 10), true);
sizeColor = Math.round(160-Math.pow((fileData.size/(1024*1024)),2));
} else {
simpleSize = t('files', 'Pending');
@@ -1529,13 +1529,18 @@
fileUploadStart.on('fileuploaddrop', function(e, data) {
OC.Upload.log('filelist handle fileuploaddrop', e, data);
- var dropTarget = $(e.originalEvent.target).closest('tr, .crumb');
- // check if dropped inside this list at all
- if (dropTarget && !self.$el.has(dropTarget).length) {
+ var dropTarget = $(e.originalEvent.target);
+ // check if dropped inside this container and not another one
+ if (dropTarget.length && !self.$el.is(dropTarget) && !self.$el.has(dropTarget).length) {
return false;
}
- if (dropTarget && (dropTarget.data('type') === 'dir' || dropTarget.hasClass('crumb'))) { // drag&drop upload to folder
+ // find the closest tr or crumb to use as target
+ dropTarget = dropTarget.closest('tr, .crumb');
+
+ // if dropping on tr or crumb, drag&drop upload to folder
+ if (dropTarget && (dropTarget.data('type') === 'dir' ||
+ dropTarget.hasClass('crumb'))) {
// remember as context
data.context = dropTarget;
@@ -1555,7 +1560,7 @@
}
// update folder in form
- data.formData = function(form) {
+ data.formData = function() {
return [
{name: 'dir', value: dir},
{name: 'requesttoken', value: oc_requesttoken},
@@ -1563,6 +1568,9 @@
];
};
} else {
+ // we are dropping somewhere inside the file list, which will
+ // upload the file to the current directory
+
// cancel uploads to current dir if no permission
var isCreatable = (self.getDirectoryPermissions() & OC.PERMISSION_CREATE) !== 0;
if (!isCreatable) {
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 92f97f5d3c0..4549de57f3f 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -258,8 +258,9 @@
// only possible at the moment if user is logged in or the files app is loaded
if (OC.currentUser && OCA.Files.App) {
// start on load - we ask the server every 5 minutes
+ var func = _.bind(OCA.Files.App.fileList.updateStorageStatistics, OCA.Files.App.fileList);
var updateStorageStatisticsInterval = 5*60*1000;
- var updateStorageStatisticsIntervalId = setInterval(OCA.Files.App.fileList.updateStorageStatistics, updateStorageStatisticsInterval);
+ var updateStorageStatisticsIntervalId = setInterval(func, updateStorageStatisticsInterval);
// TODO: this should also stop when switching to another view
// Use jquery-visibility to de-/re-activate file stats sync
@@ -267,7 +268,7 @@
$(document).on({
'show.visibility': function() {
if (!updateStorageStatisticsIntervalId) {
- updateStorageStatisticsIntervalId = setInterval(OCA.Files.App.fileList.updateStorageStatistics, updateStorageStatisticsInterval);
+ updateStorageStatisticsIntervalId = setInterval(func, updateStorageStatisticsInterval);
}
},
'hide.visibility': function() {
@@ -285,6 +286,9 @@
$settings.find('input').focus();
}
});
+ $('#webdavurl').on('click', function () {
+ $('#webdavurl').select();
+ });
//scroll to and highlight preselected file
/*
diff --git a/apps/files/js/navigation.js b/apps/files/js/navigation.js
index c58a284e83f..b959e016e8c 100644
--- a/apps/files/js/navigation.js
+++ b/apps/files/js/navigation.js
@@ -82,13 +82,13 @@
}
return;
}
- this.$el.find('li').removeClass('selected');
+ this.$el.find('li').removeClass('active');
if (this.$currentContent) {
this.$currentContent.addClass('hidden');
this.$currentContent.trigger(jQuery.Event('hide'));
}
this._activeItem = itemId;
- this.$el.find('li[data-id=' + itemId + ']').addClass('selected');
+ this.$el.find('li[data-id=' + itemId + ']').addClass('active');
this.$currentContent = $('#app-content-' + itemId);
this.$currentContent.removeClass('hidden');
if (!options || !options.silent) {