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