1
0
Fork 0
mirror of https://github.com/gorhill/uMatrix.git synced 2024-06-29 03:21:09 +12:00

fix visual glitch in recent versions of Chromium

This commit is contained in:
gorhill 2017-04-27 07:38:26 -04:00
parent 754e8213cf
commit da8cc90ab4

View file

@ -1000,13 +1000,6 @@ var makeMenu = function() {
renderMatrixHeaderRow(); renderMatrixHeaderRow();
// Manually adjust the position of the main matrix according to the height
// of the toolbar/matrix header.
document.querySelector('.paneContent').style.setProperty(
'padding-top',
document.querySelector('.paneHead').clientHeight + 'px'
);
startMatrixUpdate(); startMatrixUpdate();
makeMatrixGroup0(groupStats[0]); makeMatrixGroup0(groupStats[0]);
makeMatrixGroup1(groupStats[1]); makeMatrixGroup1(groupStats[1]);
@ -1274,9 +1267,26 @@ var onMatrixSnapshotReady = function(response) {
/******************************************************************************/ /******************************************************************************/
var resizePopup = function() { var resizePopup = (function() {
document.body.setAttribute('data-resize-popup', 'true'); var timer;
}; var fix = function() {
timer = undefined;
var doc = document;
// Manually adjust the position of the main matrix according to the
// height of the toolbar/matrix header.
doc.querySelector('.paneContent').style.setProperty(
'padding-top',
(doc.querySelector('.paneHead').clientHeight + 2) + 'px'
);
doc.body.setAttribute('data-resize-popup', 'true');
};
return function() {
if ( timer !== undefined ) {
clearTimeout(timer);
}
timer = vAPI.setTimeout(fix, 97);
};
})();
/******************************************************************************/ /******************************************************************************/
@ -1430,6 +1440,8 @@ uDom('#matList').on('click', '.g4Meta', function() {
resizePopup(); resizePopup();
}); });
resizePopup();
/******************************************************************************/ /******************************************************************************/
})(); })();