From da4efca4ecb66b7532fd8f31825d5d7ee066575c Mon Sep 17 00:00:00 2001 From: ralf Date: Fri, 6 Sep 2024 12:49:11 +0200 Subject: [PATCH] fix broken switch between list- and tile-view after change to bootstrap icons --- filemanager/js/filemanager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/filemanager/js/filemanager.ts b/filemanager/js/filemanager.ts index 687498fb6c..e4c91a9468 100644 --- a/filemanager/js/filemanager.ts +++ b/filemanager/js/filemanager.ts @@ -952,12 +952,12 @@ export class filemanagerAPP extends EgwApp // Switch view based on button icon, since controller can get re-created if(typeof view != 'string') { - view = button_widget.image.split('list_')[1].replace('.svg', ''); + view = button_widget.image.match(/\/(list|list_row)\.svg$/) ? et2_nextmatch_controller.VIEW_ROW : et2_nextmatch_controller.VIEW_TILE; } // Toggle button icon to the other view //todo: nm.controller needs to be changed to nm.getController after merging typescript branch into master - button_widget.image = ("list_" + (view == et2_nextmatch_controller.VIEW_ROW ? et2_nextmatch_controller.VIEW_TILE : et2_nextmatch_controller.VIEW_ROW)); + button_widget.image = egw.image("list_" + (view == et2_nextmatch_controller.VIEW_ROW ? et2_nextmatch_controller.VIEW_TILE : et2_nextmatch_controller.VIEW_ROW)); button_widget.statustext = (view == et2_nextmatch_controller.VIEW_ROW ? this.egw.lang("Tile view") : this.egw.lang('List view')); }