Loading ...
Sorry, an error occurred while loading the content.

Re: [yui3] Re: Centering an overlay in the viewport

Expand Messages
  • Adam Moore
    ... Please don t copy a huge chunk of YUI into your message. We need to see your code to find the problem, not YUI. Thanks, -Adam
    Message 1 of 11 , Jun 1, 2009
    • 0 Attachment
      On Sat, May 30, 2009 at 09:35:45AM -0000, derekscollon wrote:
      > When I try that variation, the overlay doesn't render at all. I should have mentioned, I'm checking this with Google Chrome on Windows Vista and Firefox 3 on both Windows XP and Centos 5. Firebug reports an error...
      >
      > align: Invalid Points Arguments

      Please don't copy a huge chunk of YUI into your message. We need to see
      your code to find the problem, not YUI.

      Thanks,

      -Adam
    • derekscollon
      ... Apologies, but I wasn t copying huge chunks of YUI, I was copying the error that was reported in the hope that that would prove useful. As it happened, it
      Message 2 of 11 , Jun 2, 2009
      • 0 Attachment
        --- In yui3@yahoogroups.com, Adam Moore <adamoore@...> wrote:
        >
        > On Sat, May 30, 2009 at 09:35:45AM -0000, derekscollon wrote:
        > > When I try that variation, the overlay doesn't render at all. I should have mentioned, I'm checking this with Google Chrome on Windows Vista and Firefox 3 on both Windows XP and Centos 5. Firebug reports an error...
        > >
        > > align: Invalid Points Arguments
        >
        > Please don't copy a huge chunk of YUI into your message. We need to see
        > your code to find the problem, not YUI.
        >
        > Thanks,
        >
        > -Adam
        >

        Apologies, but I wasn't copying huge chunks of YUI, I was copying the error that was reported in the hope that that would prove useful. As it happened, it contained a chunk of YUI. As yet, nobody has been able to say if there's any problem in my code or if the problem lies in YUI not yet being complete. If the former, I'm struggling to see the problem to be able to fix it. If the latter, I can be patient and wait for the next release.
      • Adam Moore
        ... Sorry I wasn t clear: the code that emits the error isn t what will help -- the exact code that you implemented which is causing the issue to surface is
        Message 3 of 11 , Jun 2, 2009
        • 0 Attachment
          On Tue, Jun 02, 2009 at 06:45:47PM -0000, derekscollon wrote:
          > --- In yui3@yahoogroups.com, Adam Moore <adamoore@...> wrote:
          > >
          > > On Sat, May 30, 2009 at 09:35:45AM -0000, derekscollon wrote:
          > > > When I try that variation, the overlay doesn't render at all. I should have mentioned, I'm checking this with Google Chrome on Windows Vista and Firefox 3 on both Windows XP and Centos 5. Firebug reports an error...
          > > >
          > > > align: Invalid Points Arguments
          > >
          > > Please don't copy a huge chunk of YUI into your message. We need to see
          > > your code to find the problem, not YUI.
          > >
          > > Thanks,
          > >
          > > -Adam
          > >
          >
          > Apologies, but I wasn't copying huge chunks of YUI, I was copying the error that was reported in the hope that that would prove useful. As it happened, it contained a chunk of YUI. As yet, nobody has been able to say if there's any problem in my code or if the problem lies in YUI not yet being complete. If the former, I'm struggling to see the problem to be able to fix it. If the latter, I can be patient and wait for the next release.

          Sorry I wasn't clear: the code that emits the error isn't what will help
          -- the exact code that you implemented which is causing the issue to
          surface is what we need. Please provide the source with the changes you
          mentioned so we know we are testing the same thing as you. Also, it may
          be best to move this to the bug tracking system -- if there is a YUI
          issue here, that is the way we can make sure it does get into the next
          release.

          -Adam
        • derekscollon
          ... Ah, I see what you mean. My own code was in the original post but has been chopped at some point. This is what I had originally used...
          Message 4 of 11 , Jun 2, 2009
          • 0 Attachment
            --- In yui3@yahoogroups.com, Adam Moore <adamoore@...> wrote:
            >
            > On Tue, Jun 02, 2009 at 06:45:47PM -0000, derekscollon wrote:
            > > --- In yui3@yahoogroups.com, Adam Moore <adamoore@> wrote:
            > > >
            > > > On Sat, May 30, 2009 at 09:35:45AM -0000, derekscollon wrote:
            > > > > When I try that variation, the overlay doesn't render at all. I should have mentioned, I'm checking this with Google Chrome on Windows Vista and Firefox 3 on both Windows XP and Centos 5. Firebug reports an error...
            > > > >
            > > > > align: Invalid Points Arguments
            > > >
            > > > Please don't copy a huge chunk of YUI into your message. We need to see
            > > > your code to find the problem, not YUI.
            > > >
            > > > Thanks,
            > > >
            > > > -Adam
            > > >
            > >
            > > Apologies, but I wasn't copying huge chunks of YUI, I was copying the error that was reported in the hope that that would prove useful. As it happened, it contained a chunk of YUI. As yet, nobody has been able to say if there's any problem in my code or if the problem lies in YUI not yet being complete. If the former, I'm struggling to see the problem to be able to fix it. If the latter, I can be patient and wait for the next release.
            >
            > Sorry I wasn't clear: the code that emits the error isn't what will help
            > -- the exact code that you implemented which is causing the issue to
            > surface is what we need. Please provide the source with the changes you
            > mentioned so we know we are testing the same thing as you. Also, it may
            > be best to move this to the bug tracking system -- if there is a YUI
            > issue here, that is the way we can make sure it does get into the next
            > release.
            >
            > -Adam
            >

            Ah, I see what you mean. My own code was in the original post but has been chopped at some point. This is what I had originally used...

            <script type="text/javascript">
            YUI().use("overlay", function(Y) {
            var overlay = new Y.Overlay({
            visible: true,
            });
            overlay.set("headerContent", boxHeader);
            overlay.set("bodyContent", boxBody);
            overlay.set("footerContent", boxFooter);
            overlay.set("centered", true);
            overlay.render("body");
            });
            </script>

            boxHeader, boxBody and boxFooter are set with simple text strings. This seems to place the top left corner of the overlay in the centre of the viewport. As per Caridy's suggestion, I then changed to this...

            <script type="text/javascript">
            YUI().use("overlay", function(Y) {
            var overlay = new Y.Overlay({
            visible: true,
            });
            overlay.set("headerContent", boxHeader);
            overlay.set("bodyContent", boxBody);
            overlay.set("footerContent", boxFooter);
            // Center the overlay in the viewport
            overlay.set("align", {
            center:true
            });
            overlay.render("body");
            });
            </script>

            For some reason, this version doesn't display the overlay at all.
          • Satyen Desai
            Hi, Try setting centered after the Overlay is rendered [or give it a width/height]. There does seem to be a bug here, where we re not re-centering after the
            Message 5 of 11 , Jun 2, 2009
            • 0 Attachment
              Hi,

              Try setting "centered" after the Overlay is rendered [or give it a width/height].

              There does seem to be a bug here, where we're not re-centering after the Overlay's content has been added to the DOM. What happens with your current code is that the Overlay is centered based on it's width/height without any content added (so the top/left corner is at the center of the viewport).

              Ideally you should be able to update content/alignment in any order before or after render, and still have things work - which is the bug.

              Satyen

              ________________________________________
              From: yui3@yahoogroups.com [mailto:yui3@yahoogroups.com] On Behalf Of derekscollon
              Sent: Tuesday, June 02, 2009 11:46 AM
              To: yui3@yahoogroups.com
              Subject: [yui3] Re: Centering an overlay in the viewport




              --- In yui3@yahoogroups.com, Adam Moore <adamoore@...> wrote:
              >
              > On Sat, May 30, 2009 at 09:35:45AM -0000, derekscollon wrote:
              > > When I try that variation, the overlay doesn't render at all. I should have mentioned, I'm checking this with Google Chrome on Windows Vista and Firefox 3 on both Windows XP and Centos 5. Firebug reports an error...
              > >
              > > align: Invalid Points Arguments
              >
              > Please don't copy a huge chunk of YUI into your message. We need to see
              > your code to find the problem, not YUI.
              >
              > Thanks,
              >
              > -Adam
              >

              Apologies, but I wasn't copying huge chunks of YUI, I was copying the error that was reported in the hope that that would prove useful. As it happened, it contained a chunk of YUI. As yet, nobody has been able to say if there's any problem in my code or if the problem lies in YUI not yet being complete. If the former, I'm struggling to see the problem to be able to fix it. If the latter, I can be patient and wait for the next release.
            • derekscollon
              ... Fantastic, that worked perfectly. I had assumed that centering after setting content should work and hadn t tried it after rendering. Do you want me to
              Message 6 of 11 , Jun 2, 2009
              • 0 Attachment
                --- In yui3@yahoogroups.com, "Satyen Desai" <sdesai@...> wrote:
                >
                > Hi,
                >
                > Try setting "centered" after the Overlay is rendered [or give it a width/height].
                >
                > There does seem to be a bug here, where we're not re-centering after the Overlay's content has been added to the DOM. What happens with your current code is that the Overlay is centered based on it's width/height without any content added (so the top/left corner is at the center of the viewport).
                >
                > Ideally you should be able to update content/alignment in any order before or after render, and still have things work - which is the bug.
                >
                > Satyen
                >

                Fantastic, that worked perfectly. I had assumed that centering after setting content should work and hadn't tried it after rendering. Do you want me to file this in the bug tracker then?

                Thank you to everyone who has replied.

                Derek
              • Satyen Desai
                Hi, To be clear, this works: var overlay = new Y.Overlay({ headerContent: Aligned Overlay , bodyContent: I should be in the middle of the viewport });
                Message 7 of 11 , Jun 2, 2009
                • 0 Attachment
                  Hi,

                  To be clear, this works:

                  var overlay = new Y.Overlay({
                  headerContent: "Aligned Overlay",
                  bodyContent: "I should be in the middle of the viewport"
                  });

                  overlay.render("body"); // This is when content gets added to the DOM
                  overlay.set("centered", true);

                  But this does not:

                  var overlay = new Y.Overlay({
                  headerContent: "Aligned Overlay",
                  bodyContent: "I should be in the middle of the viewport"
                  });

                  overlay.set("centered", true);
                  overlay.render("body");

                  Regards,
                  Satyen


                  ________________________________________
                  From: yui3@yahoogroups.com [mailto:yui3@yahoogroups.com] On Behalf Of Satyen Desai
                  Sent: Tuesday, June 02, 2009 12:10 PM
                  To: yui3@yahoogroups.com
                  Subject: RE: [yui3] Re: Centering an overlay in the viewport




                  Hi,

                  Try setting "centered" after the Overlay is rendered [or give it a width/height].

                  There does seem to be a bug here, where we're not re-centering after the Overlay's content has been added to the DOM. What happens with your current code is that the Overlay is centered based on it's width/height without any content added (so the top/left corner is at the center of the viewport).

                  Ideally you should be able to update content/alignment in any order before or after render, and still have things work - which is the bug.

                  Satyen

                  ________________________________________
                  From: yui3@yahoogroups.com [mailto:yui3@yahoogroups.com] On Behalf Of derekscollon
                  Sent: Tuesday, June 02, 2009 11:46 AM
                  To: yui3@yahoogroups.com
                  Subject: [yui3] Re: Centering an overlay in the viewport

                  --- In yui3@yahoogroups.com, Adam Moore <adamoore@...> wrote:
                  >
                  > On Sat, May 30, 2009 at 09:35:45AM -0000, derekscollon wrote:
                  > > When I try that variation, the overlay doesn't render at all. I should have mentioned, I'm checking this with Google Chrome on Windows Vista and Firefox 3 on both Windows XP and Centos 5. Firebug reports an error...
                  > >
                  > > align: Invalid Points Arguments
                  >
                  > Please don't copy a huge chunk of YUI into your message. We need to see
                  > your code to find the problem, not YUI.
                  >
                  > Thanks,
                  >
                  > -Adam
                  >

                  Apologies, but I wasn't copying huge chunks of YUI, I was copying the error that was reported in the hope that that would prove useful. As it happened, it contained a chunk of YUI. As yet, nobody has been able to say if there's any problem in my code or if the problem lies in YUI not yet being complete. If the former, I'm struggling to see the problem to be able to fix it. If the latter, I can be patient and wait for the next release.
                • Satyen Desai
                  Yes please. Satyen ________________________________ From: yui3@yahoogroups.com [mailto:yui3@yahoogroups.com] On Behalf Of derekscollon Sent: Tuesday, June 02,
                  Message 8 of 11 , Jun 2, 2009
                  • 0 Attachment

                    Yes please.

                     

                    Satyen

                     


                    From: yui3@yahoogroups.com [mailto: yui3@yahoogroups.com ] On Behalf Of derekscollon
                    Sent: Tuesday, June 02, 2009 12:17 PM
                    To: yui3@yahoogroups.com
                    Subject: [yui3] Re: Centering an overlay in the viewport

                     




                    --- In yui3@yahoogroups. com, "Satyen Desai" <sdesai@...> wrote:

                    >
                    > Hi,
                    >
                    > Try setting "centered" after the Overlay is rendered [or give it
                    a width/height] .
                    >
                    > There does seem to be a bug here, where we're not re-centering after the
                    Overlay's content has been added to the DOM. What happens with your current code is that the Overlay is centered based on it's width/height without any content added (so the top/left corner is at the center of the viewport).
                    >
                    > Ideally you should be able to update content/alignment in any order before
                    or after render, and still have things work - which is the bug.
                    >
                    > Satyen
                    >

                    Fantastic, that worked perfectly. I had assumed that centering after setting content should work and hadn't tried it after rendering. Do you want me to file this in the bug tracker then?

                    Thank you to everyone who has replied.

                    Derek

                  Your message has been successfully submitted and would be delivered to recipients shortly.