aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/filelist.js51
1 files changed, 37 insertions, 14 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 4790afcf4d0..12caa9da55f 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1249,23 +1249,26 @@
var nameSpan=$('<span></span>').addClass('nametext');
var innernameSpan = $('<span></span>').addClass('innernametext').text(basename);
- if (path && path !== '/') {
- var conflictingItems = this.$fileList.find('tr[data-file="' + this._jqSelEscape(name) + '"]');
- if (conflictingItems.length !== 0) {
- if (conflictingItems.length === 1) {
- // Update the path on the first conflicting item
- var $firstConflict = $(conflictingItems[0]),
- firstConflictPath = $firstConflict.attr('data-path') + '/';
- if (firstConflictPath.charAt(0) === '/') {
- firstConflictPath = firstConflictPath.substr(1);
- }
+
+ var conflictingItems = this.$fileList.find('tr[data-file="' + this._jqSelEscape(name) + '"]');
+ if (conflictingItems.length !== 0) {
+ if (conflictingItems.length === 1) {
+ // Update the path on the first conflicting item
+ var $firstConflict = $(conflictingItems[0]),
+ firstConflictPath = $firstConflict.attr('data-path') + '/';
+ if (firstConflictPath.charAt(0) === '/') {
+ firstConflictPath = firstConflictPath.substr(1);
+ }
+ if (firstConflictPath && firstConflictPath !== '/') {
$firstConflict.find('td.filename span.innernametext').prepend($('<span></span>').addClass('conflict-path').text(firstConflictPath));
}
+ }
- var conflictPath = path + '/';
- if (conflictPath.charAt(0) === '/') {
- conflictPath = conflictPath.substr(1);
- }
+ var conflictPath = path + '/';
+ if (conflictPath.charAt(0) === '/') {
+ conflictPath = conflictPath.substr(1);
+ }
+ if (path && path !== '/') {
nameSpan.append($('<span></span>').addClass('conflict-path').text(conflictPath));
}
}
@@ -2822,11 +2825,31 @@
this.$el.find('#headerName a.name>span:first').text(selection);
this.$el.find('#modified a>span:first').text('');
this.$el.find('table').addClass('multiselect');
+ this.$el.find('.selectedActions .copy-move').toggleClass('hidden', !this.isSelectedCopiableOrMovable());
+ this.$el.find('.selectedActions .download').toggleClass('hidden', !this.isSelectedDownloadable());
this.$el.find('.delete-selected').toggleClass('hidden', !this.isSelectedDeletable());
}
},
/**
+ * Check whether all selected files are copiable or movable
+ */
+ isSelectedCopiableOrMovable: function() {
+ return _.reduce(this.getSelectedFiles(), function(copiableOrMovable, file) {
+ return copiableOrMovable && (file.permissions & OC.PERMISSION_UPDATE);
+ }, true);
+ },
+
+ /**
+ * Check whether all selected files are downloadable
+ */
+ isSelectedDownloadable: function() {
+ return _.reduce(this.getSelectedFiles(), function(downloadable, file) {
+ return downloadable && (file.permissions & OC.PERMISSION_READ);
+ }, true);
+ },
+
+ /**
* Check whether all selected files are deletable
*/
isSelectedDeletable: function() {