mirror of https://github.com/gorhill/uBlock.git
Firefox: prevent currently selected tab from being reset in selector
This commit is contained in:
parent
f881697251
commit
5775fe32b8
|
@ -621,7 +621,6 @@ var synchronizeTabIds = function(newTabIds) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
option = select.options[j];
|
option = select.options[j];
|
||||||
j += 1;
|
|
||||||
if ( !option ) {
|
if ( !option ) {
|
||||||
option = document.createElement('option');
|
option = document.createElement('option');
|
||||||
select.appendChild(option);
|
select.appendChild(option);
|
||||||
|
@ -629,10 +628,12 @@ var synchronizeTabIds = function(newTabIds) {
|
||||||
option.textContent = newTabIds[tabId];
|
option.textContent = newTabIds[tabId];
|
||||||
option.value = classNameFromTabId(tabId);
|
option.value = classNameFromTabId(tabId);
|
||||||
if ( option.value === selectValue ) {
|
if ( option.value === selectValue ) {
|
||||||
|
select.selectedIndex = j;
|
||||||
option.setAttribute('selected', '');
|
option.setAttribute('selected', '');
|
||||||
} else {
|
} else {
|
||||||
option.removeAttribute('selected');
|
option.removeAttribute('selected');
|
||||||
}
|
}
|
||||||
|
j += 1;
|
||||||
}
|
}
|
||||||
while ( j < select.options.length ) {
|
while ( j < select.options.length ) {
|
||||||
select.removeChild(select.options[j]);
|
select.removeChild(select.options[j]);
|
||||||
|
|
Loading…
Reference in New Issue