Ticket #3473: replay_actionsJS_deleting_file_in_the_replay_menu_should_not_reset_the_selection.patch

File replay_actionsJS_deleting_file_in_the_replay_menu_should_not_reset_the_selection.patch, 630 bytes (added by Sergey Kushnirenko, 8 years ago)
  • replay_actions.js

     
    134134 */
    135135function reallyDeleteReplay(replayDirectory)
    136136{
     137  var wdgReplaySelection = Engine.GetGUIObjectByName("replaySelection");
     138  var selectedIndex = wdgReplaySelection.selected;
     139 
    137140    if (!Engine.DeleteReplay(replayDirectory))
    138141        error(sprintf("Could not delete replay '%(id)s'", { "id": replayDirectory }));
    139142
    140143    // Refresh replay list
    141144    init();
     145 
     146  if( g_Replays.length > 0 )
     147    wdgReplaySelection.selected = selectedIndex;
    142148}