1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-09 20:32:39 +01:00

fix padlock position bug when refreshing from popup

This commit is contained in:
gorhill 2015-02-11 14:44:08 -05:00
parent 66772daf0d
commit d0c8561ee9

View File

@ -165,6 +165,11 @@ var addFirewallRow = function(des) {
if ( popupHeight === undefined ) { if ( popupHeight === undefined ) {
popupHeight = uDom('#panes > div:nth-of-type(1)').nodeAt(0).offsetHeight; popupHeight = uDom('#panes > div:nth-of-type(1)').nodeAt(0).offsetHeight;
uDom('#panes > div:nth-of-type(2)').css('height', popupHeight + 'px'); uDom('#panes > div:nth-of-type(2)').css('height', popupHeight + 'px');
// The padlock must be manually positioned:
// - It's vertical position depends on the height on the title bar.
var rect = document.getElementById('gotoPrefs').getBoundingClientRect();
document.getElementById('saveRules').style.setProperty('top', (rect.bottom + 4) + 'px');
} }
return row; return row;
}; };
@ -276,13 +281,11 @@ var buildAllFirewallRows = function() {
dfPaneBuilt = true; dfPaneBuilt = true;
} }
// The padlock must be manually positioned, because its position depends // The padlock must be manually positioned:
// on whether there is a vertical scrollbar. // - Its horizontal position depends on whether there is a vertical
var pane = document.getElementById('firewallContainer'); // scrollbar.
var rect = pane.getBoundingClientRect(); var rect = document.getElementById('firewallContainer').getBoundingClientRect();
var padlock = document.getElementById('saveRules'); document.getElementById('saveRules').style.setProperty('left', (rect.left + 4) + 'px');
padlock.style.setProperty('left', (rect.left + 4) + 'px');
padlock.style.setProperty('top', (rect.top + 4) + 'px');
updateAllFirewallCells(); updateAllFirewallCells();
}; };