Browse Source

fix visual glitch in recent versions of Chromium

pull/2/head
gorhill 8 years ago
parent
commit
da8cc90ab4
  1. 32
      src/js/popup.js

32
src/js/popup.js

@ -1000,13 +1000,6 @@ var makeMenu = function() {
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();
makeMatrixGroup0(groupStats[0]);
makeMatrixGroup1(groupStats[1]);
@ -1274,9 +1267,26 @@ var onMatrixSnapshotReady = function(response) {
/******************************************************************************/
var resizePopup = function() {
document.body.setAttribute('data-resize-popup', 'true');
};
var resizePopup = (function() {
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();
/******************************************************************************/
})();
Loading…
Cancel
Save