aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-03-10 15:52:48 +0100
committerGitHub <noreply@github.com>2020-03-10 15:52:48 +0100
commit05c6086be648f20d507aa6509915761891e9dd40 (patch)
treebdfa5a73860fc94a97c5ed65a9c8988d6f7390f2 /apps/files/js
parent812f16880b2cf5968a351e2f9928299458ce7b3d (diff)
parentb201121e62a09518ab21ab7fd2733af8de85c75c (diff)
downloadnextcloud-server-05c6086be648f20d507aa6509915761891e9dd40.tar.gz
nextcloud-server-05c6086be648f20d507aa6509915761891e9dd40.zip
Merge pull request #19698 from nextcloud/fix/fix_image_preview_deleted_shares
Fix default action for deleted shares
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/filelist.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 2ca4185ec86..9973c92c8ec 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -131,6 +131,14 @@
dirInfo: null,
/**
+ * Whether to prevent or to execute the default file actions when the
+ * file name is clicked.
+ *
+ * @type boolean
+ */
+ _defaultFileActionsDisabled: false,
+
+ /**
* File actions handler, defaults to OCA.Files.FileActions
* @type OCA.Files.FileActions
*/
@@ -292,6 +300,10 @@
this._detailsView.$el.addClass('disappear');
}
+ if (options && options.defaultFileActionsDisabled) {
+ this._defaultFileActionsDisabled = options.defaultFileActionsDisabled
+ }
+
this._initFileActions(options.fileActions);
if (this._detailsView) {
@@ -876,7 +888,9 @@
if (!this._detailsView || $(event.target).is('.nametext, .name, .thumbnail') || $(event.target).closest('.nametext').length) {
var filename = $tr.attr('data-file');
var renaming = $tr.data('renaming');
- if (!renaming) {
+ if (this._defaultFileActionsDisabled) {
+ event.preventDefault();
+ } else if (!renaming) {
this.fileActions.currentFile = $tr.find('td');
var mime = this.fileActions.getCurrentMimeType();
var type = this.fileActions.getCurrentType();
@@ -1524,6 +1538,11 @@
"class": "name",
"href": linkUrl
});
+ if (this._defaultFileActionsDisabled) {
+ linkElem = $('<p></p>').attr({
+ "class": "name"
+ })
+ }
linkElem.append('<div class="thumbnail-wrapper"><div class="thumbnail" style="background-image:url(' + icon + ');"></div></div>');