NOBUG: Fixed file access permissions
[moodle.git] / lib / yuilib / 3.13.0 / widget-base-ie / widget-base-ie-debug.js
blob847df4eb329c07b9e419909e14d02c0243f5f873
1 /*
2 YUI 3.13.0 (build 508226d)
3 Copyright 2013 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
8 YUI.add('widget-base-ie', function (Y, NAME) {
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");
25 // TODO: Ideally we want to re-use the base _uiSizeCB impl
26 Y.Widget.prototype._uiSizeCB = function(expand) {
28     var bb = this.get(BOUNDING_BOX),
29         cb = this.get(CONTENT_BOX),
30         borderBoxSupported = this._bbs;
32     if (borderBoxSupported === undefined) {
33         this._bbs = borderBoxSupported = !(IE && IE < 8 && bb.get("ownerDocument").get("compatMode") != "BackCompat");
34     }
36     if (borderBoxSupported) {
37         cb.toggleClass(contentExpanded, expand);
38     } else {
39         if (expand) {
40             if (heightReallyMinHeight) {
41                 bb.addClass(bbTempExpanding);
42             }
44             cb.set(OFFSET_HEIGHT, bb.get(OFFSET_HEIGHT));
46             if (heightReallyMinHeight) {
47                 bb.removeClass(bbTempExpanding);
48             }
49         } else {
50             cb.setStyle(HEIGHT, EMPTY_STR);
51         }
52     }
56 }, '3.13.0', {"requires": ["widget-base"]});