From 5775fe32b86dfcff2798911c7f73a9daae823cc5 Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 1 Jul 2015 19:50:43 -0400 Subject: [PATCH] Firefox: prevent currently selected tab from being reset in selector --- src/js/logger-ui.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/logger-ui.js b/src/js/logger-ui.js index 01e24d344..2685e25be 100644 --- a/src/js/logger-ui.js +++ b/src/js/logger-ui.js @@ -621,7 +621,6 @@ var synchronizeTabIds = function(newTabIds) { continue; } option = select.options[j]; - j += 1; if ( !option ) { option = document.createElement('option'); select.appendChild(option); @@ -629,10 +628,12 @@ var synchronizeTabIds = function(newTabIds) { option.textContent = newTabIds[tabId]; option.value = classNameFromTabId(tabId); if ( option.value === selectValue ) { + select.selectedIndex = j; option.setAttribute('selected', ''); } else { option.removeAttribute('selected'); } + j += 1; } while ( j < select.options.length ) { select.removeChild(select.options[j]);