]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - jssource/src_files/include/javascript/yui3/build/widget/widget-base-ie.js
Release 6.5.0
[Github/sugarcrm.git] / jssource / src_files / include / javascript / yui3 / build / widget / widget-base-ie.js
1 /*
2 Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3 Code licensed under the BSD License:
4 http://developer.yahoo.com/yui/license.html
5 version: 3.3.0
6 build: 3167
7 */
8 YUI.add('widget-base-ie', function(Y) {
9
10 /**
11  * IE specific support for the widget-base module.
12  *
13  * @module widget-base-ie
14  */
15 var BOUNDING_BOX = "boundingBox",
16     CONTENT_BOX = "contentBox",
17     HEIGHT = "height",
18     OFFSET_HEIGHT = "offsetHeight",
19     EMPTY_STR = "",
20     IE = Y.UA.ie,
21     heightReallyMinHeight = IE < 7,
22     bbTempExpanding = Y.Widget.getClassName("tmp", "forcesize"),
23     contentExpanded = Y.Widget.getClassName("content", "expanded");
24
25 // TODO: Ideally we want to re-use the base _uiSizeCB impl
26 Y.Widget.prototype._uiSizeCB = function(expand) {
27
28     var bb = this.get(BOUNDING_BOX),
29         cb = this.get(CONTENT_BOX),
30         borderBoxSupported = this._bbs;
31
32     if(borderBoxSupported === undefined) {
33         this._bbs = borderBoxSupported = !(IE < 8 && bb.get("ownerDocument").get("compatMode") != "BackCompat"); 
34     }
35
36     if (borderBoxSupported) {
37         cb.toggleClass(contentExpanded, expand);
38     } else {
39         if (expand) {
40             if (heightReallyMinHeight) {
41                 bb.addClass(bbTempExpanding);
42             }
43
44             cb.set(OFFSET_HEIGHT, bb.get(OFFSET_HEIGHT));
45
46             if (heightReallyMinHeight) {
47                 bb.removeClass(bbTempExpanding);
48             }
49         } else {
50             cb.setStyle(HEIGHT, EMPTY_STR);
51         }
52     }
53 };
54
55
56 }, '3.3.0' ,{requires:['widget-base']});