fix broken switch between list- and tile-view after change to bootstrap icons

This commit is contained in:
ralf 2024-09-06 12:49:11 +02:00
parent 94d6b365ea
commit da4efca4ec

View File

@ -952,12 +952,12 @@ export class filemanagerAPP extends EgwApp
// Switch view based on button icon, since controller can get re-created // Switch view based on button icon, since controller can get re-created
if(typeof view != 'string') 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 // Toggle button icon to the other view
//todo: nm.controller needs to be changed to nm.getController after merging typescript branch into master //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')); button_widget.statustext = (view == et2_nextmatch_controller.VIEW_ROW ? this.egw.lang("Tile view") : this.egw.lang('List view'));
} }