popup resizes itself after style changes
This commit is contained in:
parent
708ff97723
commit
b1582d508d
|
@ -1,7 +1,6 @@
|
|||
body {
|
||||
width: 252px;
|
||||
font-size: 12px;
|
||||
height: 50px; /**/
|
||||
font-family: Arial,"Helvetica Neue",Helvetica,sans-serif;
|
||||
}
|
||||
input[type=checkbox] {
|
||||
|
@ -228,6 +227,7 @@ body>div:not(#installed) {
|
|||
justify-content: center;
|
||||
}
|
||||
#confirm {
|
||||
z-index: 2147483647;
|
||||
display: none; /* flex */
|
||||
position: absolute;
|
||||
left: 0;
|
||||
|
|
6
popup.js
6
popup.js
|
@ -82,6 +82,9 @@ function showStyles(styles) {
|
|||
styles.map(createStyleElement).forEach(function(e) {
|
||||
installed.appendChild(e);
|
||||
});
|
||||
// force Chrome to resize the popup
|
||||
document.body.style.height = '10px';
|
||||
document.documentElement.style.height = '10px';
|
||||
}
|
||||
|
||||
function createStyleElement(style) {
|
||||
|
@ -131,9 +134,6 @@ document.getElementById('confirm').addEventListener('click', e => {
|
|||
if (document.getElementById('installed').children.length === 0) {
|
||||
showStyles([]);
|
||||
}
|
||||
// force Chrome to minimize popup's height
|
||||
document.body.style.height = '10px';
|
||||
document.documentElement.style.height = '10px';
|
||||
});
|
||||
}
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue
Block a user