diff --git a/dist/bundle.js b/dist/bundle.js index a35471aaa..0878bd14c 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -22741,36 +22741,20 @@ BI.ScalingCellSizeAndPositionManager.prototype = { * version: 0.5.3 **/ !(function () { - // Check `document` and `window` in case of server-side rendering - var _window; - if (typeof window !== "undefined") { - _window = window; - } else if (typeof self !== "undefined") { - _window = self; - } else { - _window = this; - } + var attachEvent = document.attachEvent, + stylesCreated = false; - var addEventListener = typeof document !== "undefined" && document.addEventListener; - var stylesCreated = false; - - if (addEventListener) { + if (!attachEvent) { var requestFrame = (function () { - var raf = _window.requestAnimationFrame || _window.mozRequestAnimationFrame || _window.webkitRequestAnimationFrame || - function (fn) { - return _window.setTimeout(fn, 20); - }; - return function (fn) { - return raf(fn); - }; + var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || + function (fn) { return window.setTimeout(fn, 20); }; + return function (fn) { return raf(fn); }; })(); var cancelFrame = (function () { - var cancel = _window.cancelAnimationFrame || _window.mozCancelAnimationFrame || _window.webkitCancelAnimationFrame || - _window.clearTimeout; - return function (id) { - return cancel(id); - }; + var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || + window.clearTimeout; + return function (id) { return cancel(id); }; })(); var resetTriggers = function (element) { @@ -22861,7 +22845,8 @@ BI.ScalingCellSizeAndPositionManager.prototype = { }; var addResizeListener = function (element, fn) { - if (addEventListener) { + if (attachEvent) element.attachEvent("onresize", fn); + else { if (!element.__resizeTriggers__) { if (getComputedStyle(element).position === "static") element.style.position = "relative"; createStyles(); @@ -22880,21 +22865,16 @@ BI.ScalingCellSizeAndPositionManager.prototype = { }); } element.__resizeListeners__.push(fn); - - } else { - element.attachEvent("onresize", fn); } }; - var removeResizeListener = function (element, fn) { - if (addEventListener) { + if (attachEvent) element.detachEvent("onresize", fn); + else { element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1); if (!element.__resizeListeners__.length) { - element.removeEventListener("scroll", scrollListener, true); + element.removeEventListener("scroll", scrollListener); element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__); } - } else { - element.detachEvent("onresize", fn); } }; @@ -22909,7 +22889,7 @@ BI.ScalingCellSizeAndPositionManager.prototype = { removeResizeListener(widget.element[0], fn); } }; -}()); +})(); (function () { function defaultComparator (a, b) { diff --git a/dist/core.js b/dist/core.js index 8dca27156..fefdc5061 100644 --- a/dist/core.js +++ b/dist/core.js @@ -22741,36 +22741,20 @@ BI.ScalingCellSizeAndPositionManager.prototype = { * version: 0.5.3 **/ !(function () { - // Check `document` and `window` in case of server-side rendering - var _window; - if (typeof window !== "undefined") { - _window = window; - } else if (typeof self !== "undefined") { - _window = self; - } else { - _window = this; - } + var attachEvent = document.attachEvent, + stylesCreated = false; - var addEventListener = typeof document !== "undefined" && document.addEventListener; - var stylesCreated = false; - - if (addEventListener) { + if (!attachEvent) { var requestFrame = (function () { - var raf = _window.requestAnimationFrame || _window.mozRequestAnimationFrame || _window.webkitRequestAnimationFrame || - function (fn) { - return _window.setTimeout(fn, 20); - }; - return function (fn) { - return raf(fn); - }; + var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || + function (fn) { return window.setTimeout(fn, 20); }; + return function (fn) { return raf(fn); }; })(); var cancelFrame = (function () { - var cancel = _window.cancelAnimationFrame || _window.mozCancelAnimationFrame || _window.webkitCancelAnimationFrame || - _window.clearTimeout; - return function (id) { - return cancel(id); - }; + var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || + window.clearTimeout; + return function (id) { return cancel(id); }; })(); var resetTriggers = function (element) { @@ -22861,7 +22845,8 @@ BI.ScalingCellSizeAndPositionManager.prototype = { }; var addResizeListener = function (element, fn) { - if (addEventListener) { + if (attachEvent) element.attachEvent("onresize", fn); + else { if (!element.__resizeTriggers__) { if (getComputedStyle(element).position === "static") element.style.position = "relative"; createStyles(); @@ -22880,21 +22865,16 @@ BI.ScalingCellSizeAndPositionManager.prototype = { }); } element.__resizeListeners__.push(fn); - - } else { - element.attachEvent("onresize", fn); } }; - var removeResizeListener = function (element, fn) { - if (addEventListener) { + if (attachEvent) element.detachEvent("onresize", fn); + else { element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1); if (!element.__resizeListeners__.length) { - element.removeEventListener("scroll", scrollListener, true); + element.removeEventListener("scroll", scrollListener); element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__); } - } else { - element.detachEvent("onresize", fn); } }; @@ -22909,7 +22889,7 @@ BI.ScalingCellSizeAndPositionManager.prototype = { removeResizeListener(widget.element[0], fn); } }; -}()); +})(); (function () { function defaultComparator (a, b) { diff --git a/dist/fineui.js b/dist/fineui.js index c314050e1..38740382b 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -22962,36 +22962,20 @@ BI.ScalingCellSizeAndPositionManager.prototype = { * version: 0.5.3 **/ !(function () { - // Check `document` and `window` in case of server-side rendering - var _window; - if (typeof window !== "undefined") { - _window = window; - } else if (typeof self !== "undefined") { - _window = self; - } else { - _window = this; - } + var attachEvent = document.attachEvent, + stylesCreated = false; - var addEventListener = typeof document !== "undefined" && document.addEventListener; - var stylesCreated = false; - - if (addEventListener) { + if (!attachEvent) { var requestFrame = (function () { - var raf = _window.requestAnimationFrame || _window.mozRequestAnimationFrame || _window.webkitRequestAnimationFrame || - function (fn) { - return _window.setTimeout(fn, 20); - }; - return function (fn) { - return raf(fn); - }; + var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || + function (fn) { return window.setTimeout(fn, 20); }; + return function (fn) { return raf(fn); }; })(); var cancelFrame = (function () { - var cancel = _window.cancelAnimationFrame || _window.mozCancelAnimationFrame || _window.webkitCancelAnimationFrame || - _window.clearTimeout; - return function (id) { - return cancel(id); - }; + var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || + window.clearTimeout; + return function (id) { return cancel(id); }; })(); var resetTriggers = function (element) { @@ -23082,7 +23066,8 @@ BI.ScalingCellSizeAndPositionManager.prototype = { }; var addResizeListener = function (element, fn) { - if (addEventListener) { + if (attachEvent) element.attachEvent("onresize", fn); + else { if (!element.__resizeTriggers__) { if (getComputedStyle(element).position === "static") element.style.position = "relative"; createStyles(); @@ -23101,21 +23086,16 @@ BI.ScalingCellSizeAndPositionManager.prototype = { }); } element.__resizeListeners__.push(fn); - - } else { - element.attachEvent("onresize", fn); } }; - var removeResizeListener = function (element, fn) { - if (addEventListener) { + if (attachEvent) element.detachEvent("onresize", fn); + else { element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1); if (!element.__resizeListeners__.length) { - element.removeEventListener("scroll", scrollListener, true); + element.removeEventListener("scroll", scrollListener); element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__); } - } else { - element.detachEvent("onresize", fn); } }; @@ -23130,7 +23110,7 @@ BI.ScalingCellSizeAndPositionManager.prototype = { removeResizeListener(widget.element[0], fn); } }; -}()); +})(); (function () { function defaultComparator (a, b) { diff --git a/dist/utils.js b/dist/utils.js index 8606fa381..0920af641 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -14508,36 +14508,20 @@ BI.ScalingCellSizeAndPositionManager.prototype = { * version: 0.5.3 **/ !(function () { - // Check `document` and `window` in case of server-side rendering - var _window; - if (typeof window !== "undefined") { - _window = window; - } else if (typeof self !== "undefined") { - _window = self; - } else { - _window = this; - } + var attachEvent = document.attachEvent, + stylesCreated = false; - var addEventListener = typeof document !== "undefined" && document.addEventListener; - var stylesCreated = false; - - if (addEventListener) { + if (!attachEvent) { var requestFrame = (function () { - var raf = _window.requestAnimationFrame || _window.mozRequestAnimationFrame || _window.webkitRequestAnimationFrame || - function (fn) { - return _window.setTimeout(fn, 20); - }; - return function (fn) { - return raf(fn); - }; + var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || + function (fn) { return window.setTimeout(fn, 20); }; + return function (fn) { return raf(fn); }; })(); var cancelFrame = (function () { - var cancel = _window.cancelAnimationFrame || _window.mozCancelAnimationFrame || _window.webkitCancelAnimationFrame || - _window.clearTimeout; - return function (id) { - return cancel(id); - }; + var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || + window.clearTimeout; + return function (id) { return cancel(id); }; })(); var resetTriggers = function (element) { @@ -14628,7 +14612,8 @@ BI.ScalingCellSizeAndPositionManager.prototype = { }; var addResizeListener = function (element, fn) { - if (addEventListener) { + if (attachEvent) element.attachEvent("onresize", fn); + else { if (!element.__resizeTriggers__) { if (getComputedStyle(element).position === "static") element.style.position = "relative"; createStyles(); @@ -14647,21 +14632,16 @@ BI.ScalingCellSizeAndPositionManager.prototype = { }); } element.__resizeListeners__.push(fn); - - } else { - element.attachEvent("onresize", fn); } }; - var removeResizeListener = function (element, fn) { - if (addEventListener) { + if (attachEvent) element.detachEvent("onresize", fn); + else { element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1); if (!element.__resizeListeners__.length) { - element.removeEventListener("scroll", scrollListener, true); + element.removeEventListener("scroll", scrollListener); element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__); } - } else { - element.detachEvent("onresize", fn); } }; @@ -14676,7 +14656,7 @@ BI.ScalingCellSizeAndPositionManager.prototype = { removeResizeListener(widget.element[0], fn); } }; -}()); +})(); (function () { function defaultComparator (a, b) { diff --git a/src/core/utils/detectElementResize.js b/src/core/utils/detectElementResize.js index 7b50d28e8..65d128127 100644 --- a/src/core/utils/detectElementResize.js +++ b/src/core/utils/detectElementResize.js @@ -8,36 +8,20 @@ * version: 0.5.3 **/ !(function () { - // Check `document` and `window` in case of server-side rendering - var _window; - if (typeof window !== "undefined") { - _window = window; - } else if (typeof self !== "undefined") { - _window = self; - } else { - _window = this; - } - - var addEventListener = typeof document !== "undefined" && document.addEventListener; - var stylesCreated = false; + var attachEvent = document.attachEvent, + stylesCreated = false; - if (addEventListener) { + if (!attachEvent) { var requestFrame = (function () { - var raf = _window.requestAnimationFrame || _window.mozRequestAnimationFrame || _window.webkitRequestAnimationFrame || - function (fn) { - return _window.setTimeout(fn, 20); - }; - return function (fn) { - return raf(fn); - }; + var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || + function (fn) { return window.setTimeout(fn, 20); }; + return function (fn) { return raf(fn); }; })(); var cancelFrame = (function () { - var cancel = _window.cancelAnimationFrame || _window.mozCancelAnimationFrame || _window.webkitCancelAnimationFrame || - _window.clearTimeout; - return function (id) { - return cancel(id); - }; + var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || + window.clearTimeout; + return function (id) { return cancel(id); }; })(); var resetTriggers = function (element) { @@ -128,7 +112,8 @@ }; var addResizeListener = function (element, fn) { - if (addEventListener) { + if (attachEvent) element.attachEvent("onresize", fn); + else { if (!element.__resizeTriggers__) { if (getComputedStyle(element).position === "static") element.style.position = "relative"; createStyles(); @@ -147,21 +132,16 @@ }); } element.__resizeListeners__.push(fn); - - } else { - element.attachEvent("onresize", fn); } }; - var removeResizeListener = function (element, fn) { - if (addEventListener) { + if (attachEvent) element.detachEvent("onresize", fn); + else { element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1); if (!element.__resizeListeners__.length) { - element.removeEventListener("scroll", scrollListener, true); + element.removeEventListener("scroll", scrollListener); element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__); } - } else { - element.detachEvent("onresize", fn); } }; @@ -176,4 +156,4 @@ removeResizeListener(widget.element[0], fn); } }; -}()); +})();