resize popup

2,067 views
Skip to first unread message

italians...@thisisnotmyrealemail.com

unread,
Mar 4, 2010, 11:07:00 AM3/4/10
to Chromium-extensions
how can i rezize the window popup? i have some block elements that
have display css attribute to "none", when, with javascript, i change
the display attribute to "block", the window change size adapting to
content. when i change again the display attribute to "none" the
windows don't return to the old dimension.

excuse me for my english

Mohamed Mansour

unread,
Mar 6, 2010, 6:06:41 PM3/6/10
to italians...@thisisnotmyrealemail.com, Chromium-extensions
Hi,

Have you tried setting the width/height within the popup's CSS?

body {width: 500px; height: 500px;}

-
Mohamed Mansour
m...@chromium.org



--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.


Erik Kay

unread,
Mar 8, 2010, 11:44:41 AM3/8/10
to italians...@thisisnotmyrealemail.com, Chromium-extensions
This sounds like a bug.  What version of Chrome are you using (and what OS)?  Could you provide some sample code that shows this problem?

Erik

 

excuse me for my english

Pasha

unread,
Mar 9, 2010, 2:32:56 PM3/9/10
to Chromium-extensions
On Mar 8, 8:44 am, Erik Kay <erik...@chromium.org> wrote:
> This sounds like a bug. What version of Chrome are you using (and what OS)?
> Could you provide some sample code that shows this problem?

I am having the same issues on both:
Mac - 5.0.342.1
Win - 5.0.342.2

sample popup.html:
-------- 8< ---------------- 8< ---------------- 8< ----------------
8< --------
<html>
<head>
<script type="text/javascript">
function switchView(id, resizeBody) {
var views = document.getElementsByTagName("div");
var effectiveHeight = 0;
for (var i=0; i<views.length; i++) {
if (views[i].id == id) {
console.log(">>> showing: " + views[i].id);
views[i].style.display = "";
console.log(">>> " + views[i].style.height);
effectiveHeight += parseInt(views[i].style.height);
} else {
console.log(">>> Hiding: " + views[i].id);
views[i].style.display = "none"
}
}
if (resizeBody) {
document.body.style.height = effectiveHeight + "px";
}
}
</script>
</head>
<body style="width: 400px; margin: 5px; padding: 0px; border: 1px
solid black;">
<div id="alpha" style="height: 200px; border: 1px dashed green;">
<h2>I am 200px high</h2>
<a href="javascript:switchView('beta');">See another</a><br/>
<a href="javascript:switchView('beta', true);">See another and
resize BODY</a>
</div>
<div id="beta" style="height: 300px; border: 1px dashed red;
display: none;">
<h2>I am 300px high</h2>
<a href="javascript:switchView('alpha');">See another</a><br/>
<a href="javascript:switchView('alpha', true);">See another and
resize BODY</a>
</div>
</body>
</html>
-------- 8< ---------------- 8< ---------------- 8< ----------------
8< --------

There are two links - one simply switched the visibility of the two
divs and the other would also adjust the height of the body. Divs are
dashed and body is solid border... for comparison purposes. Neither of
the methods make the popup reduce in height...

It would be very nice if the popup would shrink...

Zach Williams

unread,
Mar 10, 2010, 10:20:27 AM3/10/10
to Chromium-extensions
I had the same problem for the longest time.

You need to add

<!DOCTYPE html>

to the beginning of your popup code.

On Mar 4, 10:07 am, "italianshare_m...@thisisnotmyrealemail.com"

Pasha

unread,
Mar 10, 2010, 7:15:27 PM3/10/10
to Chromium-extensions
nice... didn't think of that. much obliged!

Joshua Deltener

unread,
Mar 14, 2010, 5:32:25 PM3/14/10
to Chromium-extensions
I have a similar problem, but when I add the HTML5 doc type, I get
scrollbars in the popup when it shrinks!?

Joshua Deltener

unread,
Mar 14, 2010, 5:40:49 PM3/14/10
to Chromium-extensions
Never mind, adding CSS body {overflow: hidden;} seems to fix it.
Reply all
Reply to author
Forward
0 new messages