reverting fix to #441: undesirable side effects on Firefox

pull/2/head
gorhill 8 years ago
parent f3b98c9f9c
commit 4f63e079bc

@ -7,7 +7,7 @@ body {
min-height: 16em;
min-width: 32em;
opacity: 1;
overflow-x: auto;
overflow-x: hidden;
overflow-y: auto;
padding: 0;
}
@ -24,6 +24,7 @@ a {
left:0;
padding: 0;
position: fixed;
right: 0;
top: 0;
z-index: 10;
}

@ -1335,41 +1335,6 @@ var matrixSnapshotPoller = (function() {
/******************************************************************************/
// https://github.com/gorhill/uMatrix/pull/441
// Make the header scroll horizontally with the document.
// Ref.: resource-considerate scroll handler:
// https://developer.mozilla.org/en-US/docs/Web/Events/scroll#Example
// Won't cause DOM changes from within scroll handler.
var lastScrollX = 0;
var onScrollThrottledFired = false;
var onScrollThrottled = function() {
lastScrollX = window.scrollX;
var style = document.querySelector('.paneHead').style;
if ( lastScrollX === 0 ) {
style.removeProperty('left');
} else {
style.setProperty('left', '-' + lastScrollX + 'px');
}
onScrollThrottledFired = false;
};
var onScroll = function() {
if ( onScrollThrottledFired || window.scrollX === lastScrollX ) {
return;
}
onScrollThrottledFired = true;
self.requestAnimationFrame(onScrollThrottled);
};
if ( typeof self.requestAnimationFrame === 'function' ) {
document.addEventListener('scroll', onScroll);
}
/******************************************************************************/
// Below is UI stuff which is not key to make the menu, so this can
// be done without having to wait for a tab to be bound to the menu.

Loading…
Cancel
Save