Merge branch 'MDL-32509' of git://github.com/danpoltawski/moodle
[moodle.git] / lib / yui / 3.5.0 / build / widget-base-ie / widget-base-ie-debug.js
blob3bb65162e2b5f7b67fb24e7a0e82be20462c6079
1 /*
2 YUI 3.5.0 (build 5089)
3 Copyright 2012 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
7 YUI.add('widget-base-ie', function(Y) {
9 /**
10  * IE specific support for the widget-base module.
11  *
12  * @module widget-base-ie
13  */
14 var BOUNDING_BOX = "boundingBox",
15     CONTENT_BOX = "contentBox",
16     HEIGHT = "height",
17     OFFSET_HEIGHT = "offsetHeight",
18     EMPTY_STR = "",
19     IE = Y.UA.ie,
20     heightReallyMinHeight = IE < 7,
21     bbTempExpanding = Y.Widget.getClassName("tmp", "forcesize"),
22     contentExpanded = Y.Widget.getClassName("content", "expanded");
24 // TODO: Ideally we want to re-use the base _uiSizeCB impl
25 Y.Widget.prototype._uiSizeCB = function(expand) {
27     var bb = this.get(BOUNDING_BOX),
28         cb = this.get(CONTENT_BOX),
29         borderBoxSupported = this._bbs;
31     if (borderBoxSupported === undefined) {
32         this._bbs = borderBoxSupported = !(IE && IE < 8 && bb.get("ownerDocument").get("compatMode") != "BackCompat"); 
33     }
35     if (borderBoxSupported) {
36         cb.toggleClass(contentExpanded, expand);
37     } else {
38         if (expand) {
39             if (heightReallyMinHeight) {
40                 bb.addClass(bbTempExpanding);
41             }
43             cb.set(OFFSET_HEIGHT, bb.get(OFFSET_HEIGHT));
45             if (heightReallyMinHeight) {
46                 bb.removeClass(bbTempExpanding);
47             }
48         } else {
49             cb.setStyle(HEIGHT, EMPTY_STR);
50         }
51     }
55 }, '3.5.0' ,{requires:['widget-base']});