Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Commit

Permalink
fix reload button (regression from 2256552)
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Sep 30, 2018
1 parent 77a7b8f commit fc0bb7a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/js/logger-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,14 +555,16 @@ var pageSelectorChanged = function() {

/******************************************************************************/

var refreshTab = function() {
var tabClass = document.getElementById('pageSelector').value;
var matches = tabClass.match(/^tab_(.+)$/);
if ( matches === null ) { return; }
if ( matches[1] === 'bts' ) { return; }
var reloadTab = function(ev) {
let tabId = document.getElementById('pageSelector').value;
if ( /^\d+$/.test(tabId) === false ) { return; }
vAPI.messaging.send(
'logger-ui.js',
{ what: 'forceReloadTab', tabId: parseInt(matches[1], 10) }
'default',
{
what: 'forceReloadTab',
tabId: parseInt(tabId, 10),
bypassCache: ev && (ev.ctrlKey || ev.metaKey || ev.shiftKey)
}
);
};

Expand Down Expand Up @@ -1078,7 +1080,7 @@ window.addEventListener('beforeunload', releaseView);
readLogBuffer();

uDom('#pageSelector').on('change', pageSelectorChanged);
uDom('#refresh').on('click', refreshTab);
uDom('#refresh').on('click', reloadTab);
uDom('#compactViewToggler').on('click', toggleCompactView);
uDom('#clean').on('click', cleanBuffer);
uDom('#clear').on('click', clearBuffer);
Expand Down

0 comments on commit fc0bb7a

Please sign in to comment.