mirror of https://github.com/gorhill/uBlock.git
Replace old resizing code with CSS flex
This commit is contained in:
parent
c02349979c
commit
9845e4d61a
|
@ -1,14 +1,18 @@
|
|||
html, body {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
justify-content: stretch;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
width: 100vw;
|
||||
}
|
||||
#dashboard-nav {
|
||||
background-color: var(--default-surface);
|
||||
border: 0;
|
||||
box-shadow: var(--dashboard-bar-shadow);
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
flex-wrap: wrap;
|
||||
overflow-x: hidden;
|
||||
padding: 0;
|
||||
|
@ -48,6 +52,7 @@ html, body {
|
|||
iframe {
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
flex-grow: 1;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
|
|
|
@ -30,16 +30,6 @@
|
|||
|
||||
/******************************************************************************/
|
||||
|
||||
const resizeFrame = function() {
|
||||
const navRect = document.getElementById('dashboard-nav')
|
||||
.getBoundingClientRect();
|
||||
const viewRect = document.documentElement.getBoundingClientRect();
|
||||
document.getElementById('iframe').style.setProperty(
|
||||
'height',
|
||||
(viewRect.height - navRect.height) + 'px'
|
||||
);
|
||||
};
|
||||
|
||||
const discardUnsavedData = function(synchronous = false) {
|
||||
const paneFrame = document.getElementById('iframe');
|
||||
const paneWindow = paneFrame.contentWindow;
|
||||
|
@ -121,12 +111,9 @@ vAPI.messaging.send('dashboard', {
|
|||
document.body.classList.toggle('canUpdateShortcuts', response === true);
|
||||
});
|
||||
|
||||
resizeFrame();
|
||||
|
||||
vAPI.localStorage.getItemAsync('dashboardLastVisitedPane').then(value => {
|
||||
loadDashboardPanel(value !== null ? value : 'settings.html', true);
|
||||
|
||||
window.addEventListener('resize', resizeFrame);
|
||||
uDom('.tabButton').on('click', onTabClickHandler);
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
||||
|
|
Loading…
Reference in New Issue