1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-02 17:19:38 +02:00

code review for #3428

This commit is contained in:
Raymond Hill 2018-02-26 16:52:16 -05:00
parent 7f41875cca
commit 0414ce80a0
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -48,7 +48,9 @@ var removeAllChildren = logger.removeAllChildren = function(node) {
var tabIdFromClassName = function(className) {
var matches = className.match(/\btab_([^ ]+)\b/);
return matches !== null ? matches[1] : '';
if ( matches === null ) { return 0; }
if ( matches[1] === 'bts' ) { return -1; }
return parseInt(matches[1], 10);
};
var tabIdFromPageSelector = logger.tabIdFromPageSelector = function() {
@ -1609,12 +1611,7 @@ var popupManager = (function() {
var toggleOn = function(td) {
var tr = td.parentNode;
realTabId = localTabId = tabIdFromClassName(tr.className);
if ( realTabId === '' ) {
return;
}
if ( localTabId === 'bts' ) {
realTabId = -1;
}
if ( realTabId === 0 ) { return; }
container = uDom.nodeFromId('popupContainer');