Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
PopupPanel.center() not working in Firefox 3.5.5
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
David T  
View profile  
 More options Nov 25 2009, 7:59 pm
From: David T <davidte...@gmail.com>
Date: Wed, 25 Nov 2009 16:59:38 -0800 (PST)
Local: Wed, Nov 25 2009 7:59 pm
Subject: PopupPanel.center() not working in Firefox 3.5.5
Hi All,

I'm trying to use the provided PopupPanel.center() method to center a
popup panel on the screen. This works fine on Opera and Safari
centering the popup relative to the browser window. In Firefox though
it centers the popup relative to the entire page.

I've tried to implement my own center method as follows:

private void center() {
        popup.setPopupPositionAndShow(new PositionCallback() {

                public void setPosition(int offsetWidth, int offsetHeight)
                {
                        int[] winSize = windowSize();
                        int left = (winSize[0] - offsetWidth) >> 1;
                        int top = (winSize[1] - offsetHeight) >> 1;
                        popup.setPopupPosition(Window.getScrollLeft() + left,
Window.getScrollTop() + top);
                }

        });

}

public final native int[] windowSize() /*-{
        var myWidth = 0, myHeight = 0;
        if (typeof(window.innerWidth) == 'number') {
                //Non-IE
                myWidth = window.innerWidth;
                myHeight = window.innerHeight;
        } else if (document.documentElement &&
                (document.documentElement.clientWidth ||
document.documentElement.clientHeight)) {
                //IE 6+ in 'standards compliant mode'
                myWidth = document.documentElement.clientWidth;
                myHeight = document.documentElement.clientHeight;
        } else if (document.body && (document.body.clientWidth ||
document.body.clientHeight)) {
                //IE 4 compatible
                myWidth = document.body.clientWidth;
                myHeight = document.body.clientHeight;
        }
        return [myWidth, myHeight];

}-*/;

But this doesn't work as the windowSize() method returns 0 for reasons
I don't know.

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David T  
View profile  
 More options Nov 25 2009, 7:59 pm
From: David T <davidte...@gmail.com>
Date: Wed, 25 Nov 2009 16:59:43 -0800 (PST)
Local: Wed, Nov 25 2009 7:59 pm
Subject: PopupPanel.center() not working in Firefox 3.5.5
Hi All,

I'm trying to use the provided PopupPanel.center() method to center a
popup panel on the screen. This works fine on Opera and Safari
centering the popup relative to the browser window. In Firefox though
it centers the popup relative to the entire page.

I've tried to implement my own center method as follows:

private void center() {
        popup.setPopupPositionAndShow(new PositionCallback() {

                public void setPosition(int offsetWidth, int offsetHeight)
                {
                        int[] winSize = windowSize();
                        int left = (winSize[0] - offsetWidth) >> 1;
                        int top = (winSize[1] - offsetHeight) >> 1;
                        popup.setPopupPosition(Window.getScrollLeft() + left,
Window.getScrollTop() + top);
                }

        });

}

public final native int[] windowSize() /*-{
        var myWidth = 0, myHeight = 0;
        if (typeof(window.innerWidth) == 'number') {
                //Non-IE
                myWidth = window.innerWidth;
                myHeight = window.innerHeight;
        } else if (document.documentElement &&
                (document.documentElement.clientWidth ||
document.documentElement.clientHeight)) {
                //IE 6+ in 'standards compliant mode'
                myWidth = document.documentElement.clientWidth;
                myHeight = document.documentElement.clientHeight;
        } else if (document.body && (document.body.clientWidth ||
document.body.clientHeight)) {
                //IE 4 compatible
                myWidth = document.body.clientWidth;
                myHeight = document.body.clientHeight;
        }
        return [myWidth, myHeight];

}-*/;

But this doesn't work as the windowSize() method returns 0 for reasons
I don't know.

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dazza  
View profile  
 More options Nov 26 2009, 6:11 pm
From: Dazza <dazzacoll...@gmail.com>
Date: Thu, 26 Nov 2009 15:11:44 -0800 (PST)
Local: Thurs, Nov 26 2009 6:11 pm
Subject: Re: PopupPanel.center() not working in Firefox 3.5.5
Why aren't you using GWT provided Window.getClientWidth() and
Window.getClientHeight()?

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David T  
View profile  
 More options Nov 29 2009, 7:26 pm
From: David T <davidte...@gmail.com>
Date: Sun, 29 Nov 2009 16:26:58 -0800 (PST)
Local: Sun, Nov 29 2009 7:26 pm
Subject: Re: PopupPanel.center() not working in Firefox 3.5.5
They have the same problem as using PopupPanel.center(), for firefox
they return the web page dimensions instead of the browser window
dimensions. I implemented my own method to try to fix this.

On Nov 27, 10:11 am, Dazza <dazzacoll...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas Broyer  
View profile   Translate to Translated (View Original)
 More options Nov 30 2009, 5:37 am
From: Thomas Broyer <t.bro...@gmail.com>
Date: Mon, 30 Nov 2009 02:37:20 -0800 (PST)
Local: Mon, Nov 30 2009 5:37 am
Subject: Re: PopupPanel.center() not working in Firefox 3.5.5

On Nov 26, 1:59 am, David T <davidte...@gmail.com> wrote:

You use 'window' and 'document', which refer to the hidden iframe's
window and document your GWT code is loaded in (your
<permutation>.cache.html). You should always use $wnd and $doc in JSNI
code.

(and I agree PopupPanel.center() should use window.innerHeight/Width
where possible; at least when the document is smaller than the window;
have you filed a bug?)


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David T  
View profile  
 More options Dec 7 2009, 9:14 pm
From: David T <davidte...@gmail.com>
Date: Mon, 7 Dec 2009 18:14:37 -0800 (PST)
Local: Mon, Dec 7 2009 9:14 pm
Subject: Re: PopupPanel.center() not working in Firefox 3.5.5
Great! Worked perfectly thank you.

Yeah I will look at filing a bug report.

On Nov 30, 9:37 pm, Thomas Broyer <t.bro...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas Broyer  
View profile  
 More options Dec 8 2009, 9:53 am
From: Thomas Broyer <t.bro...@gmail.com>
Date: Tue, 8 Dec 2009 06:53:37 -0800 (PST)
Local: Tues, Dec 8 2009 9:53 am
Subject: Re: PopupPanel.center() not working in Firefox 3.5.5

On Nov 30, 11:37 am, Thomas Broyer <t.bro...@gmail.com> wrote:

> (and I agree PopupPanel.center() should use window.innerHeight/Width
> where possible; at least when the document is smaller than the window;
> have you filed a bug?)

I just changed some popups (DialogBox) from setPosition+show to center
() and they display correctly in FF3.5, even when the document is
smaller than the window.
The page is in "standards mode", in case it changes something (which I
believe it could). And I'm using GWT 2.0 RC2 (I'm setting
setGlassEnabled(true) and the glass correctly overlays everything: the
whole viewport when the document is small than the window, or the
whole document when there's a scrollbar)

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David T  
View profile  
 More options Dec 8 2009, 10:04 pm
From: David T <davidte...@gmail.com>
Date: Tue, 8 Dec 2009 19:04:23 -0800 (PST)
Local: Tues, Dec 8 2009 10:04 pm
Subject: Re: PopupPanel.center() not working in Firefox 3.5.5
Yeah I'm not exactly sure what is causing it, doesn't seem to be that
PopupPanel.center() is broken outright. I tried playing around with
the code to see if I pin point the bug but wasn't able to. I'm using
GWT 1.7 though.

For those interested though here is the full code for a work around:

private void center() {
    popup.setPopupPositionAndShow(new PositionCallback() {
    @Override
        public void setPosition(int offsetWidth, int offsetHeight) a {
            int[] winSize = windowSize();
            int left = (winSize[0] - offsetWidth) >> 1;
            int top = (winSize[1] - offsetHeight) >> 1;
            popup.setPopupPosition(Window.getScrollLeft() + left,
                    Window.getScrollTop() + top);
        }
    });

}

private final native int[] windowSize() /*-{
    var myWidth = 0, myHeight = 0;
    if (typeof($wnd.innerWidth) == 'number') {
        //Non-IE
        myWidth = $wnd.innerWidth;
        myHeight = $wnd.innerHeight;
    } else if ($doc.documentElement &&
        ($doc.documentElement.clientWidth ||
        $doc.documentElement.clientHeight)) {
        //IE 6+ in 'standards compliant mode'
        myWidth = $doc.documentElement.clientWidth;
        myHeight = $doc.documentElement.clientHeight;
    } else if ($doc.body && ($doc.body.clientWidth ||
            $doc.body.clientHeight)) {
        //IE 4 compatible
        myWidth = $doc.body.clientWidth;
        myHeight = $doc.body.clientHeight;
    }
    return [myWidth, myHeight];

}-*/;

On Dec 9, 1:53 am, Thomas Broyer <t.bro...@gmail.com> wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google