| 1 |
efrain |
1 |
YUI.add('widget-base-ie', function (Y, NAME) {
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* IE specific support for the widget-base module.
|
|
|
5 |
*
|
|
|
6 |
* @module widget-base-ie
|
|
|
7 |
*/
|
|
|
8 |
var BOUNDING_BOX = "boundingBox",
|
|
|
9 |
CONTENT_BOX = "contentBox",
|
|
|
10 |
HEIGHT = "height",
|
|
|
11 |
OFFSET_HEIGHT = "offsetHeight",
|
|
|
12 |
EMPTY_STR = "",
|
|
|
13 |
IE = Y.UA.ie,
|
|
|
14 |
heightReallyMinHeight = IE < 7,
|
|
|
15 |
bbTempExpanding = Y.Widget.getClassName("tmp", "forcesize"),
|
|
|
16 |
contentExpanded = Y.Widget.getClassName("content", "expanded");
|
|
|
17 |
|
|
|
18 |
// TODO: Ideally we want to re-use the base _uiSizeCB impl
|
|
|
19 |
Y.Widget.prototype._uiSizeCB = function(expand) {
|
|
|
20 |
|
|
|
21 |
var bb = this.get(BOUNDING_BOX),
|
|
|
22 |
cb = this.get(CONTENT_BOX),
|
|
|
23 |
borderBoxSupported = this._bbs;
|
|
|
24 |
|
|
|
25 |
if (borderBoxSupported === undefined) {
|
|
|
26 |
this._bbs = borderBoxSupported = !(IE && IE < 8 && bb.get("ownerDocument").get("compatMode") != "BackCompat");
|
|
|
27 |
}
|
|
|
28 |
|
|
|
29 |
if (borderBoxSupported) {
|
|
|
30 |
cb.toggleClass(contentExpanded, expand);
|
|
|
31 |
} else {
|
|
|
32 |
if (expand) {
|
|
|
33 |
if (heightReallyMinHeight) {
|
|
|
34 |
bb.addClass(bbTempExpanding);
|
|
|
35 |
}
|
|
|
36 |
|
|
|
37 |
cb.set(OFFSET_HEIGHT, bb.get(OFFSET_HEIGHT));
|
|
|
38 |
|
|
|
39 |
if (heightReallyMinHeight) {
|
|
|
40 |
bb.removeClass(bbTempExpanding);
|
|
|
41 |
}
|
|
|
42 |
} else {
|
|
|
43 |
cb.setStyle(HEIGHT, EMPTY_STR);
|
|
|
44 |
}
|
|
|
45 |
}
|
|
|
46 |
};
|
|
|
47 |
|
|
|
48 |
|
|
|
49 |
}, '3.18.1', {"requires": ["widget-base"]});
|