aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js/filelist.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/js/filelist.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 bdf1df90e45..7930eee7354 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>');