~ted/lazr-js/annoying-debug-message

« back to all changes in this revision

Viewing changes to src-js/lazrjs/yui/widget/widget-base.js

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-09-09 14:20:30 UTC
  • mfrom: (182.1.3 yui-3.2)
  • Revision ID: launchpad@pqm.canonical.com-20100909142030-13w6vo0ixfysxc15
[r=beuno] Update lazr-js to yui-3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3
3
Code licensed under the BSD License:
4
4
http://developer.yahoo.com/yui/license.html
5
 
version: 3.1.2
6
 
build: 56
 
5
version: 3.2.0
 
6
build: 2676
7
7
*/
8
8
YUI.add('widget-base', function(Y) {
9
9
 
458
458
            delete _instances[bbGuid];
459
459
        }
460
460
 
461
 
        Y.each(_delegates, function (info) {
 
461
        Y.each(_delegates, function (info, key) {
462
462
            if (info.instances[widgetGuid]) {
463
463
                //  Unregister this Widget instance as needing this delegated
464
464
                //  event listener.
466
466
 
467
467
                //  There are no more Widget instances using this delegated 
468
468
                //  event listener, so detach it.
469
 
                if (Y.Object.size(info.instances) === 0) {
 
469
 
 
470
                if (Y.Object.isEmpty(info.instances)) {
470
471
                    info.handle.detach();
 
472
 
 
473
                    if (_delegates[key]) {
 
474
                        delete _delegates[key];
 
475
                    }
471
476
                }
472
477
            }
473
478
        });
1231
1236
            info = _delegates[key],
1232
1237
            handle;
1233
1238
 
1234
 
        //  For each Node instance: Ensure that there is only one delegated 
 
1239
        //  For each Node instance: Ensure that there is only one delegated
1235
1240
        //  event listener used to fire Widget UI events.
1236
1241
 
1237
1242
        if (!info) {
1238
1243
 
1239
 
 
1240
1244
            handle = parentNode.delegate(type, function (evt) {
1241
1245
 
1242
1246
                var widget = Widget.getByNode(this);
1243
 
 
1244
1247
                //  Make the DOM event a property of the custom event
1245
1248
                //  so that developers still have access to it.
1246
1249
                widget.fire(evt.type, { domEvent: evt });
1248
1251
            }, "." + _getWidgetClassName());
1249
1252
 
1250
1253
            _delegates[key] = info = { instances: {}, handle: handle };
1251
 
 
1252
1254
        }
1253
1255
 
1254
1256
        //  Register this Widget as using this Node as a delegation container.
1255
1257
        info.instances[Y.stamp(this)] = 1;
1256
 
 
1257
1258
    },
1258
1259
 
1259
1260
    /**
1336
1337
Y.Widget = Widget;
1337
1338
 
1338
1339
 
1339
 
}, '3.1.2' ,{requires:['attribute', 'event-focus', 'base', 'node', 'classnamemanager', 'intl']});
 
1340
}, '3.2.0' ,{requires:['attribute', 'event-focus', 'base-base', 'base-pluginhost', 'node-base', 'node-style', 'node-event-delegate', 'classnamemanager']});