diff --git a/apps/files/css/files.scss b/apps/files/css/files.scss index 9d9daabc27997d4215a3e09082518dcaacd3da69..b826f305d146a5fe68286b477f139d393d98cf90 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 2ca4185ec863ba91a3638758a5c19c10e97176c5..9973c92c8ece246fd41b48ce8dd65de068e5a786 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -130,6 +130,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>'); diff --git a/apps/files_sharing/js/app.js b/apps/files_sharing/js/app.js index 781bbfb65e32a95af0bbb9578e7df79d5e25e813..ab503c6bfee0a0047b826957e450c9a4274aabf2 100644 --- a/apps/files_sharing/js/app.js +++ b/apps/files_sharing/js/app.js @@ -111,6 +111,7 @@ OCA.Sharing.App = { $el, { id: 'shares.deleted', + defaultFileActionsDisabled: true, showDeleted: true, sharedWithUser: true, fileActions: this._restoreShareAction(), diff --git a/apps/files_sharing/js/dist/files_sharing.js b/apps/files_sharing/js/dist/files_sharing.js index a3fae08e7286807cc7544bfa69fec68eaf09f69a..756939fb31e0bf5a1f0568b095324a86be6322fe 100644 Binary files a/apps/files_sharing/js/dist/files_sharing.js and b/apps/files_sharing/js/dist/files_sharing.js differ diff --git a/apps/files_sharing/js/dist/files_sharing.js.map b/apps/files_sharing/js/dist/files_sharing.js.map index 70142ed64604071f04c64f2a8853691d1e5f099b..1fafd160dd1b721858811dbff4f5053b44bbb0bb 100644 Binary files a/apps/files_sharing/js/dist/files_sharing.js.map and b/apps/files_sharing/js/dist/files_sharing.js.map differ