~bjornt/lazr-js/prefetch-yui-3.5

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-01-14 23:32:29 UTC
  • mfrom: (197.1.7 yui-3.3.0)
  • Revision ID: launchpad@pqm.canonical.com-20110114233229-r6i4cazdiiw18o7p
Upgrade to YUI 3.3.0 [r=mars]

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.2.0
6
 
build: 2676
 
5
version: 3.3.0
 
6
build: 3167
7
7
*/
8
8
YUI.add('widget-base', function(Y) {
9
9
 
43
43
    CONTENT_BOX = "contentBox",
44
44
    PARENT_NODE = "parentNode",
45
45
    OWNER_DOCUMENT = "ownerDocument",
46
 
    OFFSET_HEIGHT = "offsetHeight",
47
46
    AUTO = "auto",
48
47
    SRC_NODE = "srcNode",
49
48
    BODY = "body",
50
 
        TAB_INDEX = "tabIndex",
 
49
    TAB_INDEX = "tabIndex",
51
50
    ID = "id",
52
51
    RENDER = "render",
53
52
    RENDERED = "rendered",
56
55
    DIV = "<div></div>",
57
56
    CHANGE = "Change",
58
57
    LOADING = "loading",
 
58
 
59
59
    _UISET = "_uiSet",
60
60
 
61
61
    EMPTY_STR = "",
62
62
    EMPTY_FN = function() {},
63
63
 
64
 
    UI_EVENT_REGEX = /(\w+):(\w+)/,
65
 
    UI_EVENT_REGEX_REPLACE = "$2",
66
 
 
67
64
    TRUE = true,
68
65
    FALSE = false,
69
66
 
72
69
    UI_ATTRS = [VISIBLE, DISABLED, HEIGHT, WIDTH, FOCUSED],
73
70
 
74
71
    WEBKIT = Y.UA.webkit,
75
 
    IE = Y.UA.ie,
76
 
 
77
 
    ContentUpdate = "contentUpdate",
78
 
 
79
 
    //  Map of Node instances serving as a delegation containers for a specific
80
 
    //  event type to Widget instances using that delegation container.
81
 
    _delegates = {},
82
72
 
83
73
    // Widget nodeguid-to-instance map.
84
74
    _instances = {};
103
93
function Widget(config) {
104
94
    Y.log('constructor called', 'life', 'widget');
105
95
 
106
 
    this._strs = {};
107
 
 
108
 
    this._cssPrefix = this.constructor.CSS_PREFIX || _getClassName(this.constructor.NAME.toLowerCase());
109
 
 
110
 
    Widget.superclass.constructor.apply(this, arguments);
111
 
 
112
 
    var render = this.get(RENDER), parentNode;
 
96
    // kweight
 
97
    var widget = this,
 
98
        parentNode,
 
99
        render, 
 
100
        constructor = widget.constructor; 
 
101
 
 
102
    widget._strs = {};
 
103
    widget._cssPrefix = constructor.CSS_PREFIX || _getClassName(constructor.NAME.toLowerCase());
 
104
 
 
105
    Widget.superclass.constructor.apply(widget, arguments);
 
106
 
 
107
    render = widget.get(RENDER);
 
108
 
113
109
    if (render) {
114
110
        // Render could be a node or boolean
115
111
        if (render !== TRUE) {
116
112
            parentNode = render;
117
113
        }
118
 
        this.render(parentNode);
 
114
        widget.render(parentNode);
119
115
    }
120
116
}
121
117
 
197
193
 
198
194
/**
199
195
 * @attribute contentBox
200
 
 * @description A DOM node that is a direct descendent of a Widget's bounding box that 
 
196
 * @description A DOM node that is a direct descendant of a Widget's bounding box that 
201
197
 * houses its content.
202
198
 * @type String | Node
203
199
 * @writeOnce
217
213
 * method), while being removed from the default tab flow.  A value of 
218
214
 * null removes the "tabIndex" attribute from the widget's bounding box.
219
215
 * @type Number
220
 
 * @default 0
 
216
 * @default null
221
217
 */
222
218
ATTRS[TAB_INDEX] = {
223
 
        value: null,
224
 
        validator: "_validTabIndex"
 
219
    value: null,
 
220
    validator: "_validTabIndex"
225
221
};
226
222
 
227
223
/**
364
360
 
365
361
Y.extend(Widget, Y.Base, {
366
362
 
367
 
        /**
368
 
         * Returns a class name prefixed with the the value of the 
369
 
         * <code>YUI.config.classNamePrefix</code> attribute + the instances <code>NAME</code> property.
370
 
         * Uses <code>YUI.config.classNameDelimiter</code> attribute to delimit the provided strings.
371
 
         * e.g. 
372
 
         * <code>
373
 
         * <pre>
374
 
         *    // returns "yui-slider-foo-bar", for a slider instance
375
 
         *    var scn = slider.getClassName('foo','bar');
376
 
         *
377
 
         *    // returns "yui-overlay-foo-bar", for an overlay instance
378
 
         *    var ocn = overlay.getClassName('foo','bar');
379
 
         * </pre>
380
 
         * </code>
381
 
         *
382
 
         * @method getClassName
383
 
         * @param {String}+ One or more classname bits to be joined and prefixed
384
 
         */
385
 
        getClassName: function () {
 
363
    /**
 
364
     * Returns a class name prefixed with the the value of the 
 
365
     * <code>YUI.config.classNamePrefix</code> attribute + the instances <code>NAME</code> property.
 
366
     * Uses <code>YUI.config.classNameDelimiter</code> attribute to delimit the provided strings.
 
367
     * e.g. 
 
368
     * <code>
 
369
     * <pre>
 
370
     *    // returns "yui-slider-foo-bar", for a slider instance
 
371
     *    var scn = slider.getClassName('foo','bar');
 
372
     *
 
373
     *    // returns "yui-overlay-foo-bar", for an overlay instance
 
374
     *    var ocn = overlay.getClassName('foo','bar');
 
375
     * </pre>
 
376
     * </code>
 
377
     *
 
378
     * @method getClassName
 
379
     * @param {String}+ One or more classname bits to be joined and prefixed
 
380
     */
 
381
    getClassName: function () {
386
382
        return _getClassName.apply(ClassNameManager, [this._cssPrefix].concat(Y.Array(arguments), true));
387
 
        },
388
 
 
389
 
    /**
390
 
     * Returns the name of the skin that's currently applied to the widget.
391
 
     * This is only really useful after the widget's DOM structure is in the
392
 
     * document, either by render or by progressive enhancement.  Searches up
393
 
     * the Widget's ancestor axis for a class yui3-skin-(name), and returns the
394
 
     * (name) portion.  Otherwise, returns null.
395
 
     *
396
 
     * @method getSkinName
397
 
     * @return {String} the name of the skin, or null (yui3-skin-sam => sam)
398
 
     */
399
 
    getSkinName: function () {
400
 
        var root = this.get( CONTENT_BOX ) || this.get( BOUNDING_BOX ),
401
 
            search = new RegExp( '\\b' + _getClassName( 'skin' ) + '-(\\S+)' ),
402
 
            match;
403
 
 
404
 
        if ( root ) {
405
 
            root.ancestor( function ( node ) {
406
 
                match = node.get( 'className' ).match( search );
407
 
                return match;
408
 
            } );
409
 
        }
410
 
 
411
 
        return ( match ) ? match[1] : null;
412
383
    },
413
384
 
414
385
    /**
435
406
         * @preventable false
436
407
         * @param {EventFacade} e The Event Facade
437
408
         */
438
 
        this.publish(ContentUpdate, { preventable:FALSE });
439
409
 
440
410
        if (this._applyParser) {
441
411
            this._applyParser(config);
454
424
        Y.log('destructor called', 'life', 'widget');
455
425
 
456
426
        var boundingBox = this.get(BOUNDING_BOX),
457
 
            bbGuid = Y.stamp(boundingBox, TRUE),
458
 
            widgetGuid = Y.stamp(this, TRUE);
 
427
            contentBox = this.get(CONTENT_BOX),
 
428
            bbGuid = Y.stamp(boundingBox, TRUE);
459
429
 
460
430
        if (bbGuid in _instances) {
461
431
            delete _instances[bbGuid];
462
432
        }
463
433
 
464
 
        Y.each(_delegates, function (info, key) {
465
 
            if (info.instances[widgetGuid]) {
466
 
                //  Unregister this Widget instance as needing this delegated
467
 
                //  event listener.
468
 
                delete info.instances[widgetGuid];
469
 
 
470
 
                //  There are no more Widget instances using this delegated 
471
 
                //  event listener, so detach it.
472
 
 
473
 
                if (Y.Object.isEmpty(info.instances)) {
474
 
                    info.handle.detach();
475
 
 
476
 
                    if (_delegates[key]) {
477
 
                        delete _delegates[key];
478
 
                    }
479
 
                }
480
 
            }
481
 
        });
 
434
        if (this.UI_EVENTS) {
 
435
            this._destroyUIEvents();
 
436
        }
482
437
 
483
438
        this._unbindUI(boundingBox);
 
439
 
 
440
        if (contentBox) { // Just to be safe because it's a last minute change. Really shouldn't be required.
 
441
            contentBox.remove(TRUE);
 
442
        }
484
443
        boundingBox.remove(TRUE);
485
444
    },
486
445
 
515
474
 
516
475
        if (!this.get(DESTROYED) && !this.get(RENDERED)) {
517
476
             /**
518
 
              * Lifcyle event for the render phase, fired prior to rendering the UI 
 
477
              * Lifecycle event for the render phase, fired prior to rendering the UI 
519
478
              * for the widget (prior to invoking the widget's renderer method).
520
479
              * <p>
521
480
              * Subscribers to the "on" moment of this event, will be notified 
569
528
     * @protected
570
529
     */
571
530
    renderer: function() {
572
 
        this._renderUI();
573
 
        this.renderUI();
574
 
 
575
 
        this._bindUI();
576
 
        this.bindUI();
577
 
 
578
 
        this._syncUI();
579
 
        this.syncUI();
 
531
        // kweight
 
532
        var widget = this;
 
533
 
 
534
        widget._renderUI();
 
535
        widget.renderUI();
 
536
 
 
537
        widget._bindUI();
 
538
        widget.bindUI();
 
539
 
 
540
        widget._syncUI();
 
541
        widget.syncUI();
580
542
    },
581
543
 
582
544
    /**
590
552
     */
591
553
    bindUI: EMPTY_FN,
592
554
 
593
 
    /**
 
555
    /**å
594
556
     * Adds nodes to the DOM 
595
557
     * 
596
558
     * This method is not called by framework and is not chained 
675
637
     * @param {boolean} expand
676
638
     */
677
639
    _uiSizeCB : function(expand) {
678
 
 
679
 
        var bb = this.get(BOUNDING_BOX),
680
 
            cb = this.get(CONTENT_BOX),
681
 
 
682
 
            bbTempExpanding = _getWidgetClassName("tmp", "forcesize"),
683
 
 
684
 
            borderBoxSupported = this._bbs,
685
 
            heightReallyMinHeight = IE && IE < 7;
686
 
 
687
 
        if (borderBoxSupported) {
688
 
            cb.toggleClass(_getWidgetClassName(CONTENT, "expanded"), expand);
689
 
        } else {
690
 
            if (expand) {
691
 
                if (heightReallyMinHeight) {
692
 
                    bb.addClass(bbTempExpanding);
693
 
                }
694
 
 
695
 
                cb.set(OFFSET_HEIGHT, bb.get(OFFSET_HEIGHT));
696
 
 
697
 
                if (heightReallyMinHeight) {
698
 
                    bb.removeClass(bbTempExpanding);
699
 
                }
700
 
            } else {
701
 
                cb.setStyle(HEIGHT, EMPTY_STR);
702
 
            }
703
 
        }
 
640
        this.get(CONTENT_BOX).toggleClass(_getWidgetClassName(CONTENT, "expanded"), expand);        
704
641
    },
705
642
 
706
643
    /**
718
655
    _renderBox: function(parentNode) {
719
656
 
720
657
        // TODO: Performance Optimization [ More effective algo to reduce Node refs, compares, replaces? ]
721
 
 
722
 
        var contentBox = this.get(CONTENT_BOX),
723
 
            boundingBox = this.get(BOUNDING_BOX),
724
 
            srcNode = this.get(SRC_NODE),
725
 
            defParentNode = this.DEF_PARENT_NODE,
 
658
        
 
659
        var widget = this, // kweight
 
660
            contentBox = widget.get(CONTENT_BOX),
 
661
            boundingBox = widget.get(BOUNDING_BOX),
 
662
            srcNode = widget.get(SRC_NODE),
 
663
            defParentNode = widget.DEF_PARENT_NODE,
726
664
 
727
665
            doc = (srcNode && srcNode.get(OWNER_DOCUMENT)) || boundingBox.get(OWNER_DOCUMENT) || contentBox.get(OWNER_DOCUMENT);
728
666
 
746
684
        } else if (!boundingBox.inDoc(doc)) {
747
685
            Node.one(BODY).insert(boundingBox, 0);
748
686
        }
749
 
 
750
 
        this._bbs = !(IE && IE < 8 && doc.compatMode != "BackCompat");
751
687
    },
752
688
 
753
689
    /**
842
778
        this.get(CONTENT_BOX).addClass(this.getClassName(CONTENT));
843
779
    },
844
780
 
845
 
 
846
781
    /**
847
782
     * Removes class names representative of the widget's loading state from 
848
783
     * the boundingBox.
853
788
    _removeLoadingClassNames: function () {
854
789
 
855
790
        var boundingBox = this.get(BOUNDING_BOX),
856
 
            contentBox = this.get(CONTENT_BOX);
857
 
 
858
 
        boundingBox.removeClass(_getWidgetClassName(LOADING));
859
 
        boundingBox.removeClass(this.getClassName(LOADING));
860
 
        
861
 
        contentBox.removeClass(_getWidgetClassName(LOADING));
862
 
        contentBox.removeClass(this.getClassName(LOADING));
863
 
        
 
791
            contentBox = this.get(CONTENT_BOX),
 
792
            instClass = this.getClassName(LOADING),
 
793
            widgetClass = _getWidgetClassName(LOADING);
 
794
 
 
795
        boundingBox.removeClass(widgetClass)
 
796
                   .removeClass(instClass);
 
797
 
 
798
        contentBox.removeClass(widgetClass)
 
799
                  .removeClass(instClass);
864
800
    },
865
801
 
866
802
    /**
870
806
     * @protected
871
807
     */
872
808
    _bindUI: function() {
873
 
        this._bindAttrUI(this._BIND_UI_ATTRS);
 
809
        this._bindAttrUI(this._UI_ATTRS.BIND);
874
810
        this._bindDOM();
875
811
    },
876
812
 
889
825
     * @protected
890
826
     */
891
827
    _bindDOM : function() {
892
 
                var oDocument = this.get(BOUNDING_BOX).get(OWNER_DOCUMENT);
 
828
        var oDocument = this.get(BOUNDING_BOX).get(OWNER_DOCUMENT);
893
829
 
894
830
        // TODO: Perf Optimization: Use Widget.getByNode delegation, to get by 
895
831
        // with just one _onDocFocus subscription per sandbox, instead of one per widget
896
 
                this._hDocFocus = oDocument.on("focus", this._onDocFocus, this);
 
832
        this._hDocFocus = oDocument.on("focus", this._onDocFocus, this);
897
833
 
898
 
                //      Fix for Webkit:
899
 
                //      Document doesn't receive focus in Webkit when the user mouses 
900
 
                //      down on it, so the "focused" attribute won't get set to the 
901
 
                //      correct value.
902
 
                if (WEBKIT) {
903
 
                        this._hDocMouseDown = oDocument.on("mousedown", this._onDocMouseDown, this);
904
 
                }
 
834
        //      Fix for Webkit:
 
835
        //      Document doesn't receive focus in Webkit when the user mouses 
 
836
        //      down on it, so the "focused" attribute won't get set to the 
 
837
        //      correct value.
 
838
        if (WEBKIT) {
 
839
            this._hDocMouseDown = oDocument.on("mousedown", this._onDocMouseDown, this);
 
840
        }
905
841
    },
906
842
 
907
843
    /**
925
861
     * @protected
926
862
     */
927
863
    _syncUI: function() {
928
 
        this._syncAttrUI(this._SYNC_UI_ATTRS);
 
864
        this._syncAttrUI(this._UI_ATTRS.SYNC);
929
865
    },
930
866
 
931
867
    /**
992
928
     */
993
929
    _uiSetFocused: function(val, src) {
994
930
         var boundingBox = this.get(BOUNDING_BOX);
995
 
 
996
931
         boundingBox.toggleClass(this.getClassName(FOCUSED), val);
 
932
 
997
933
         if (src !== UI) {
998
934
            if (val) {
999
935
                boundingBox.focus();  
1011
947
     * @param Number
1012
948
     */
1013
949
    _uiSetTabIndex: function(index) {
1014
 
                var boundingBox = this.get(BOUNDING_BOX);
 
950
        var boundingBox = this.get(BOUNDING_BOX);
1015
951
 
1016
 
                if (L.isNumber(index)) {
1017
 
                        boundingBox.set(TAB_INDEX, index);
1018
 
                } else {
1019
 
                        boundingBox.removeAttribute(TAB_INDEX);
1020
 
                }
 
952
        if (L.isNumber(index)) {
 
953
            boundingBox.set(TAB_INDEX, index);
 
954
        } else {
 
955
            boundingBox.removeAttribute(TAB_INDEX);
 
956
        }
1021
957
    },
1022
958
 
1023
 
        /**
1024
 
         * @method _onDocMouseDown
1025
 
         * @description "mousedown" event handler for the owner document of the 
1026
 
         * widget's bounding box.
1027
 
         * @protected
 
959
    /**
 
960
     * @method _onDocMouseDown
 
961
     * @description "mousedown" event handler for the owner document of the 
 
962
     * widget's bounding box.
 
963
     * @protected
1028
964
     * @param {EventFacade} evt The event facade for the DOM focus event
1029
 
         */
1030
 
        _onDocMouseDown: function (evt) {
1031
 
                if (this._hasDOMFocus) {
1032
 
                        this._onDocFocus(evt);
1033
 
                }
1034
 
        },
 
965
     */
 
966
    _onDocMouseDown: function (evt) {
 
967
        if (this._domFocus) {
 
968
            this._onDocFocus(evt);
 
969
        }
 
970
    },
1035
971
 
1036
972
    /**
1037
973
     * DOM focus event handler, used to sync the state of the Widget with the DOM
1041
977
     * @param {EventFacade} evt The event facade for the DOM focus event
1042
978
     */
1043
979
    _onDocFocus: function (evt) {
1044
 
                var bFocused = this.get(BOUNDING_BOX).contains(evt.target); // contains() checks invoking node also
1045
 
 
1046
 
                this._hasDOMFocus = bFocused;
1047
 
        this._set(FOCUSED, bFocused, { src: UI });
 
980
        this._domFocus = this.get(BOUNDING_BOX).contains(evt.target); // contains() checks invoking node also
 
981
        this._set(FOCUSED, this._domFocus, { src: UI });
1048
982
    },
1049
983
 
1050
984
    /**
1054
988
     * @return {String} The default string value for the widget [ displays the NAME of the instance, and the unique id ]
1055
989
     */
1056
990
    toString: function() {
1057
 
        return this.constructor.NAME + "[" + this.get(ID) + "]";
 
991
        // Using deprecated name prop for kweight squeeze.
 
992
        return this.name + "[" + this.get(ID) + "]";
1058
993
    },
1059
994
 
1060
995
    /**
1187
1122
    },
1188
1123
 
1189
1124
    /**
1190
 
     * The list of UI attributes to bind for Widget's _bindUI implementation
1191
 
     *
1192
 
     * @property _BIND_UI_ATTRS
1193
 
     * @type Array
1194
 
     * @private
1195
 
     */
1196
 
    _BIND_UI_ATTRS : UI_ATTRS,
1197
 
 
1198
 
    /**
1199
 
     * The list of UI attributes to sync for Widget's _syncUI implementation
1200
 
     *
1201
 
     * @property _SYNC_UI_ATTRS
1202
 
     * @type Array
1203
 
     * @private
1204
 
     */
1205
 
    _SYNC_UI_ATTRS : UI_ATTRS.concat(TAB_INDEX),
1206
 
 
1207
 
    /**
1208
 
     * Map of DOM events that should be fired as Custom Events by the  
1209
 
     * Widget instance.
1210
 
     *
1211
 
     * @property UI_EVENTS
 
1125
     * The lists of UI attributes to bind and sync for widget's _bindUI and _syncUI implementations
 
1126
     *
 
1127
     * @property _UI_ATTRS
1212
1128
     * @type Object
1213
 
     */
1214
 
    UI_EVENTS: Y.Node.DOM_EVENTS,
1215
 
 
1216
 
    /**
1217
 
     * Returns the node on which to bind delegate listeners.
1218
 
     *
1219
 
     * @method _getUIEventNode
1220
 
     * @protected
1221
 
     */
1222
 
    _getUIEventNode: function () {
1223
 
        return this.get(BOUNDING_BOX);
1224
 
    },
1225
 
 
1226
 
    /**
1227
 
     * Binds a delegated DOM event listener of the specified type to the 
1228
 
     * Widget's outtermost DOM element to facilitate the firing of a Custom
1229
 
     * Event of the same type for the Widget instance.  
1230
 
     *
1231
 
     * @private
1232
 
     * @method _createUIEvent
1233
 
     * @param type {String} String representing the name of the event
1234
 
     */
1235
 
    _createUIEvent: function (type) {
1236
 
 
1237
 
        var uiEvtNode = this._getUIEventNode(),
1238
 
            parentNode = uiEvtNode.get(PARENT_NODE),
1239
 
            key = (Y.stamp(parentNode) + type),
1240
 
            info = _delegates[key],
1241
 
            handle;
1242
 
 
1243
 
        //  For each Node instance: Ensure that there is only one delegated
1244
 
        //  event listener used to fire Widget UI events.
1245
 
 
1246
 
        if (!info) {
1247
 
            Y.log("Creating delegate for the " + type + " event.", "info", "widget");
1248
 
 
1249
 
            handle = parentNode.delegate(type, function (evt) {
1250
 
 
1251
 
                var widget = Widget.getByNode(this);
1252
 
                //  Make the DOM event a property of the custom event
1253
 
                //  so that developers still have access to it.
1254
 
                widget.fire(evt.type, { domEvent: evt });
1255
 
 
1256
 
            }, "." + _getWidgetClassName());
1257
 
 
1258
 
            _delegates[key] = info = { instances: {}, handle: handle };
1259
 
        }
1260
 
 
1261
 
        //  Register this Widget as using this Node as a delegation container.
1262
 
        info.instances[Y.stamp(this)] = 1;
1263
 
    },
1264
 
 
1265
 
    /**
1266
 
     * Determines if the specified event is a UI event.
1267
 
     *
1268
 
     * @private
1269
 
     * @method _isUIEvent
1270
 
     * @param type {String} String representing the name of the event
1271
 
     * @return {String} Event Returns the name of the UI Event, otherwise 
1272
 
     * undefined.
1273
 
     */
1274
 
    _getUIEvent: function (type) {
1275
 
        if (L.isString(type)) {
1276
 
            var sType = type.replace(UI_EVENT_REGEX, UI_EVENT_REGEX_REPLACE),
1277
 
                returnVal;
1278
 
 
1279
 
            if (this.UI_EVENTS[sType]) {
1280
 
                returnVal = sType;
1281
 
            }
1282
 
 
1283
 
            return returnVal;
1284
 
        }
1285
 
    },
1286
 
 
1287
 
    /**
1288
 
     * Sets up infastructure required to fire a UI event.
1289
 
     * 
1290
 
     * @private
1291
 
     * @method _initUIEvent
1292
 
     * @param type {String} String representing the name of the event
1293
 
     * @return {String}     
1294
 
     */
1295
 
    _initUIEvent: function (type) {
1296
 
        var sType = this._getUIEvent(type),
1297
 
            queue = this._uiEvtsInitQueue || {};
1298
 
 
1299
 
        if (sType && !queue[sType]) {
1300
 
            Y.log("Deferring creation of " + type + " delegate until render.", "info", "widget");
1301
 
 
1302
 
            this._uiEvtsInitQueue = queue[sType] = 1;
1303
 
 
1304
 
            this.after(RENDER, function() { 
1305
 
                this._createUIEvent(sType);
1306
 
                delete this._uiEvtsInitQueue[sType];
1307
 
            });
1308
 
        }
1309
 
    },
1310
 
 
1311
 
    //  Override of "on" from Base to facilitate the firing of Widget events
1312
 
    //  based on DOM events of the same name/type (e.g. "click", "mouseover").
1313
 
    //  Temporary solution until we have the ability to listen to when 
1314
 
    //  someone adds an event listener (bug 2528230)
1315
 
    on: function (type) {
1316
 
        this._initUIEvent(type);
1317
 
        return Widget.superclass.on.apply(this, arguments);
1318
 
    },
1319
 
 
1320
 
    //  Override of "after" from Base to facilitate the firing of Widget events
1321
 
    //  based on DOM events of the same name/type (e.g. "click", "mouseover").    
1322
 
    //  Temporary solution until we have the ability to listen to when 
1323
 
    //  someone adds an event listener (bug 2528230)    
1324
 
    after: function (type) {
1325
 
        this._initUIEvent(type);
1326
 
        return Widget.superclass.after.apply(this, arguments);
1327
 
    },
1328
 
 
1329
 
    //  Override of "publish" from Base to facilitate the firing of Widget events
1330
 
    //  based on DOM events of the same name/type (e.g. "click", "mouseover").    
1331
 
    //  Temporary solution until we have the ability to listen to when 
1332
 
    //  someone publishes an event (bug 2528230)     
1333
 
    publish: function (type, config) {
1334
 
        var sType = this._getUIEvent(type);
1335
 
        if (sType && config && config.defaultFn) {
1336
 
            this._initUIEvent(sType);
1337
 
        }        
1338
 
        return Widget.superclass.publish.apply(this, arguments);
 
1129
     * @private
 
1130
     */
 
1131
    _UI_ATTRS : {
 
1132
        BIND: UI_ATTRS,
 
1133
        SYNC: UI_ATTRS.concat(TAB_INDEX)
1339
1134
    }
1340
 
 
1341
1135
});
1342
1136
 
1343
1137
Y.Widget = Widget;
1344
1138
 
1345
1139
 
1346
 
}, '3.2.0' ,{requires:['attribute', 'event-focus', 'base-base', 'base-pluginhost', 'node-base', 'node-style', 'node-event-delegate', 'classnamemanager']});
 
1140
}, '3.3.0' ,{requires:['attribute', 'event-focus', 'base-base', 'base-pluginhost', 'node-base', 'node-style', 'node-event-delegate', 'classnamemanager']});