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')); }