This commit is contained in:
gorhill 2015-05-23 07:31:46 -04:00
parent 73ac79feff
commit e968f392ef
2 changed files with 19 additions and 1 deletions

View File

@ -468,7 +468,7 @@ body.portrait #firewallContainer > div > span:nth-of-type(4) {
display: none;
left: 4px;
padding: 0;
position: absolute;
position: fixed;
top: 4px;
}
#rulesetTools > span {

View File

@ -45,6 +45,21 @@ document.querySelector('#panes > div:nth-of-type(2)').style.setProperty(
document.querySelector('#panes > div:nth-of-type(1)').offsetHeight + 'px'
);
// The padlock/eraser must be manually positioned:
// - Its vertical position depends on the height of the popup title bar
// - Its horizontal position depends on whether there is a vertical scrollbar.
document.getElementById('rulesetTools').style.setProperty(
'top',
(document.getElementById('gotoPrefs').getBoundingClientRect().bottom + 3) + 'px'
);
var positionRulesetTools = function() {
document.getElementById('rulesetTools').style.setProperty(
'left',
(document.getElementById('firewallContainer').getBoundingClientRect().left + 3) + 'px'
);
};
// https://github.com/chrisaljoudi/uBlock/issues/996
// Experimental: mitigate glitchy popup UI: immediately set the firewall pane
// visibility to its last known state. By default the pane is hidden.
@ -284,6 +299,8 @@ var updateAllFirewallCells = function() {
);
}
positionRulesetTools();
uDom('#firewallContainer').toggleClass(
'dirty',
popupData.matrixIsDirty === true
@ -648,6 +665,7 @@ var toggleMinimize = function() {
name: 'firewallPaneMinimized',
value: popupData.firewallPaneMinimized
});
positionRulesetTools();
};
/******************************************************************************/