• Register
  • Log In
  • Home
  • Quick Start
    • Configurator
    • Download YUI 3
  • Documentation
    • User Guides
    • Examples
    • API Docs
    • Environments
    • Tutorials
  • Community
    • Gallery
    • Blog
    • Forums
    • YUI Theater
    • Calendar
  • Contribute
    • YUI on GitHub »
    • File a Ticket
    • View Tickets
    • Dashboard
  • Other Projects
    • Shifter »
    • Yogi »
    • YUI 2
    • YUI Doc »
    • YUI Test
    • YUI Website
    • YUI Compressor »
    • YUI Builder »
    • YUI PHP Loader
    • Grid Builder »
    • Skin Builder »
  • YUI
  • >
  • Community
  • >
  • Gallery

Gallery

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • Yogi Documentation
  • Shifter Documentation
  • Developer Guide
  • Module Setup

Tag Cloud

Context Navigation

    YUI Library is not responsible for bugs or support with this module. It is available as a free service. For support please contact the module owner with the provided links.

    Patch: 3.3.0 AsyncQueue event bubbling (gallery-patch-330-async-queue-bubble) on cdn

    Last Updated: 02/9/11
    + 0 -

    Luke Smith

    YUI Contributor

    See 19 more by this user.

    Created: 01/26/11
    Last CDN Push: 01/26/11
    Build Tag: gallery-2011.01.26-20-33
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.3.0
    Free for use.

    This patch adds a missing event prefix to the AsyncQueue events, allowing them to be subscribed to from a bubble target.

    See the example snippet below for the case where the behavior fails without this patch.

    This patch module is only necessary for version 3.3.0.

    • Tags:
    • lsmith
    • async-queue
    • patch
    • bug
    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    Apply the patch in the use() statement as long as version 3.3.0 is in use. Remove from the use() statement after upgrading to the subsequent version.

    Code Sample

    <script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script>
    YUI({
        //Last Gallery Build of this module
        gallery: 'gallery-2011.01.26-20-33'
    }).use('async-queue', 'gallery-patch-330-async-queue-bubble', function(Y) {
     
        // The bug would be triggered by any EventTarget extension that is configured with a prefix
        // This is commonly seen as the NAME static property of Y.Base subclasses, such as Plugin or Widget.
        // In the below case, 'myclass'
        Y.MyClass = Y.Base.create('myclass', Y.Base, [], { /* prototype */ }, { /* static properties */ });
     
        var instance = new Y.MyClass(),
            queue = new Y.AsyncQueue();
     
        // Make events from queue bubble to instance
        queue.addTarget(instance);
     
        // Has worked, and continues to work
        queue.on("execute", function (e) {
            console.log("Callback executed (logged from AsyncQueue subscription)");
        });
     
        // This doesn't work in 3.3.0 without this patch.  There was no namespace to identify the event origin
        // so the bubble target's prefix would be assumed, but that is a different event. This patch adds the
        // prefix 'queue'
        instance.on("queue:execute", function (e) {
            console.log("Executing a callback from queue (logged from MyClass subscription)");
        });
     
    });

    © 2006-2013 Yahoo! Inc. All rights reserved.
    All code on this site is licensed under the BSD License unless stated otherwise.
    About This Site · Security Contact Info