From d0494ce286f3f04730fa3f9f92d9ad90d82c9669 Mon Sep 17 00:00:00 2001 From: ralf Date: Tue, 2 Aug 2022 14:59:03 +0200 Subject: [PATCH] fix "No appropriate target application" error when trying to open a directory in filemanager with a double click caused by et2-image href attribute being set to the row-id / vfs-path and causing et2-image click handler to call egw.open_link with the vfs-path as url overwriting _handleClick now for et2-vfs-mime to only call expose, but never the parent (et2-image) _handleClick, so action-system get a chance to handle it --- api/js/etemplate/Et2Vfs/Et2VfsMime.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/api/js/etemplate/Et2Vfs/Et2VfsMime.ts b/api/js/etemplate/Et2Vfs/Et2VfsMime.ts index 414fc402db..99bd613e39 100644 --- a/api/js/etemplate/Et2Vfs/Et2VfsMime.ts +++ b/api/js/etemplate/Et2Vfs/Et2VfsMime.ts @@ -81,6 +81,12 @@ export class Et2VfsMime extends Et2ImageExpose */ isExposable() : boolean { + // do not try to expose directories, they are handled by the action system + if (this.exposeValue.mime === Et2VfsMime.DIR_MIME_TYPE) + { + return false; + } + let gallery = super.isExposable(); // @ts-ignore Wants an argument, but does not require it @@ -93,6 +99,21 @@ export class Et2VfsMime extends Et2ImageExpose return gallery; } + /** + * Override et2-image click-handler, to not call egw.open_link with href= + * + * @param {MouseEvent} _ev + * @returns {boolean} + */ + _handleClick(_ev : MouseEvent) : boolean + { + if(this.isExposable()) + { + this.expose_onclick(_ev); + } + return false; + } + /** * Some files cannot be opened in gallery, but we still want to do something with them * Editable files we open on click.