[ 6 posts ]

Daniel Ji

  • Username: humblepie
  • Joined: Tue Feb 28, 2012 10:30 am
  • Posts: 147
  • GitHub: humblepie
  • Gists: humblepie
  • Offline
  • Profile
Tags:

YUI user guide corrections (EventTarget)

Post Posted: Wed Mar 21, 2012 12:32 pm
+0-
Hi everyone,

Where do I report bugs in the code samples found in the user guides?

I think I might have found a bug in the EventTarget user guide:

http://yuilibrary.com/yui/docs/event-cu ... -instances

The code sample refers to

Code:
    Y.Global.on('*:message', function (e) {
        if (e.origin !== id) {
            alert("message received from " + e.origin + ": " + e.message);
        }
    });


But it only worked for me when I removed the * prefix

Code:
    Y.Global.on('message', function (e) {
        if (e.origin !== id) {
            alert("message received from " + e.origin + ": " + e.message);
        }
    });


In the following callback I believe e.originInstance should be e.origin. Also, this callback is never invoked so e.origin is never set with the unique ID. I'm not sure what the fix is for this.
Code:
// Stamp outgoing messages with this instance's id
    Y.on('message', function (e) {
        e.originInstance = id;
    });



Thanks.

Daniel Ji

  • Username: humblepie
  • Joined: Tue Feb 28, 2012 10:30 am
  • Posts: 147
  • GitHub: humblepie
  • Gists: humblepie
  • Offline
  • Profile

Re: YUI user guide corrections (EventTarget)

Post Posted: Wed Mar 21, 2012 12:35 pm
+0-
I am using FF 11 and have tried this sample code with YUI 3.4.1, 3.5 pr2 and pr4.

Thanks.

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: YUI user guide corrections (EventTarget)

Post Posted: Wed Mar 21, 2012 12:57 pm
+0-
Feel free to file this here:

http://yuilibrary.com/projects/yui3/new ... nent=Event

Daniel Ji

  • Username: humblepie
  • Joined: Tue Feb 28, 2012 10:30 am
  • Posts: 147
  • GitHub: humblepie
  • Gists: humblepie
  • Offline
  • Profile
Tags:

Re: YUI user guide corrections (EventTarget)

Post Posted: Wed Mar 21, 2012 1:09 pm
+0-
Thanks Dav.

I created the following ticket for anyone interested.

http://yuilibrary.com/projects/yui3/ticket/2531925

Daniel Ji

  • Username: humblepie
  • Joined: Tue Feb 28, 2012 10:30 am
  • Posts: 147
  • GitHub: humblepie
  • Gists: humblepie
  • Offline
  • Profile
Tags:

Re: YUI user guide corrections (EventTarget)

Post Posted: Tue Mar 27, 2012 2:48 pm
+0-
The user guide has been updated now. It all makes sense now :) Thanks Luke.

http://stage.yuilibrary.com/yui/docs/ev ... -instances

Luke Smith

YUI Contributor

  • Username: lsmith
  • Joined: Thu Aug 28, 2008 7:50 am
  • Posts: 507
  • Location: Sunnyvale
  • Twitter: ls_n
  • GitHub: lsmith
  • Gists: lsmith
  • IRC: ls_n
  • YUI Developer
  • Offline
  • Profile

Re: YUI user guide corrections (EventTarget)

Post Posted: Tue Mar 27, 2012 9:23 pm
+0-
Glad to help, and thanks for the report! Let us know if you see anything else awry.
  [ 6 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum