mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-15 15:32:28 +02:00
code review: adjust position of eraser/padlock only when needed
This commit is contained in:
parent
18459161e6
commit
c695599860
@ -61,12 +61,11 @@ if (
|
|||||||
// The padlock/eraser must be manually positioned:
|
// The padlock/eraser must be manually positioned:
|
||||||
// - Its vertical position depends on the height of the popup title bar
|
// - Its vertical position depends on the height of the popup title bar
|
||||||
// - Its horizontal position depends on whether there is a vertical scrollbar.
|
// - Its horizontal position depends on whether there is a vertical scrollbar.
|
||||||
document.getElementById('rulesetTools').style.setProperty(
|
|
||||||
'top',
|
|
||||||
(document.getElementById('appinfo').getBoundingClientRect().bottom + 3) + 'px'
|
|
||||||
);
|
|
||||||
|
|
||||||
var positionRulesetTools = function() {
|
var positionRulesetTools = function() {
|
||||||
|
document.getElementById('rulesetTools').style.setProperty(
|
||||||
|
'top',
|
||||||
|
(document.getElementById('appinfo').getBoundingClientRect().bottom + 3) + 'px'
|
||||||
|
);
|
||||||
document.getElementById('rulesetTools').style.setProperty(
|
document.getElementById('rulesetTools').style.setProperty(
|
||||||
'left',
|
'left',
|
||||||
(document.getElementById('firewallContainer').getBoundingClientRect().left + 3) + 'px'
|
(document.getElementById('firewallContainer').getBoundingClientRect().left + 3) + 'px'
|
||||||
@ -317,12 +316,11 @@ var updateAllFirewallCells = function() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
positionRulesetTools();
|
var dirty = popupData.matrixIsDirty === true;
|
||||||
|
if ( dirty ) {
|
||||||
uDom.nodeFromId('firewallContainer').classList.toggle(
|
positionRulesetTools();
|
||||||
'dirty',
|
}
|
||||||
popupData.matrixIsDirty === true
|
uDom.nodeFromId('firewallContainer').classList.toggle('dirty', dirty);
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
Loading…
Reference in New Issue
Block a user