From e152db70042737b5f0c19b76c562cdff9cf76931 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 18 Oct 2015 13:41:33 -0400 Subject: [PATCH] limit search of adjacent button to current toolbar --- platform/firefox/vapi-background.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index b815b06a0..6dbb71158 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -2424,7 +2424,7 @@ vAPI.toolbarButton = { toolbarButtonPanel.addEventListener('popuphiding', tbb.onViewHiding); toolbarButton.appendChild(toolbarButtonPanel); - if ( palette !== null ) { + if ( palette !== null && palette.querySelector('#' + tbb.id) === null ) { palette.appendChild(toolbarButton); } @@ -2453,7 +2453,7 @@ vAPI.toolbarButton = { // Found our button on this toolbar - but where on it? var before = null; for ( var i = index + 1; i < currentset.length; i++ ) { - before = document.getElementById(currentset[i]); + before = toolbar.querySelector('[id="' + currentset[i] + '"]'); if ( before !== null ) { break; }