summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorGretaD <gretadoci@gmail.com>2020-02-28 15:27:31 +0100
committernpmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>2020-03-09 20:16:38 +0000
commitb201121e62a09518ab21ab7fd2733af8de85c75c (patch)
treea8def123ec9c8f485400447bace7e5613ac512dd /apps/files
parent0d613cd2f03e7d683a782fbb161026db6e4cb3d1 (diff)
downloadnextcloud-server-b201121e62a09518ab21ab7fd2733af8de85c75c.tar.gz
nextcloud-server-b201121e62a09518ab21ab7fd2733af8de85c75c.zip
Fix default action for deleted shares
Signed-off-by: GretaD <gretadoci@gmail.com> Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/css/files.scss9
-rw-r--r--apps/files/js/filelist.js21
2 files changed, 27 insertions, 3 deletions
diff --git a/apps/files/css/files.scss b/apps/files/css/files.scss
index 9d9daabc279..b826f305d14 100644
--- a/apps/files/css/files.scss
+++ b/apps/files/css/files.scss
@@ -320,7 +320,8 @@ table td.fileaction {
width: 32px;
text-align: center;
}
-table td.filename a.name {
+table td.filename a.name,
+table td.filename p.name {
display: flex;
position:relative; /* Firefox needs to explicitly have this default set … */
-moz-box-sizing: border-box;
@@ -356,6 +357,9 @@ table td.filename .thumbnail {
position: absolute;
z-index: 4;
}
+table td.filename p.name .thumbnail {
+ cursor: default;
+}
// Show slight border around previews for images, txt, etc.
table tr[data-has-preview='true'] .thumbnail {
@@ -477,7 +481,8 @@ table td.selection {
-webkit-transition:background-image 500ms; -moz-transition:background-image 500ms; -o-transition:background-image 500ms; transition:background-image 500ms;
}
-#fileList tr td.filename a.name label {
+#fileList tr td.filename a.name label,
+#fileList tr td.filename p.name label {
position: absolute;
width: 80%;
height: 50px;
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>');