From 28803eac03d8c3f9fd3d33a15f0c1b2f10ee5779 Mon Sep 17 00:00:00 2001 From: Young Date: Wed, 18 Jul 2018 19:01:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?BI-27386=20layer=E5=B1=82=E5=88=9B=E5=BB=BA?= =?UTF-8?q?invisible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/bundle.js | 1 + dist/core.js | 1 + dist/fineui.js | 1 + src/core/controller/controller.layer.js | 1 + 4 files changed, 4 insertions(+) diff --git a/dist/bundle.js b/dist/bundle.js index c22b1f5718..aaa2f7d57e 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -26936,6 +26936,7 @@ BI.LayerController = BI.inherit(BI.Controller, { }, op), context); var layout = BI.createWidget({ type: "bi.absolute", + invisible: true, items: [{ el: widget, left: 0, diff --git a/dist/core.js b/dist/core.js index 345ee03e37..dd463aeb2b 100644 --- a/dist/core.js +++ b/dist/core.js @@ -26936,6 +26936,7 @@ BI.LayerController = BI.inherit(BI.Controller, { }, op), context); var layout = BI.createWidget({ type: "bi.absolute", + invisible: true, items: [{ el: widget, left: 0, diff --git a/dist/fineui.js b/dist/fineui.js index 575b7bb8ac..93289fe574 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -27185,6 +27185,7 @@ BI.LayerController = BI.inherit(BI.Controller, { }, op), context); var layout = BI.createWidget({ type: "bi.absolute", + invisible: true, items: [{ el: widget, left: 0, diff --git a/src/core/controller/controller.layer.js b/src/core/controller/controller.layer.js index 59e24ee999..7e4b6841d2 100644 --- a/src/core/controller/controller.layer.js +++ b/src/core/controller/controller.layer.js @@ -59,6 +59,7 @@ BI.LayerController = BI.inherit(BI.Controller, { }, op), context); var layout = BI.createWidget({ type: "bi.absolute", + invisible: true, items: [{ el: widget, left: 0, From 9ae4cc4e87d959f98aa6819833e6a735bb26f4d5 Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 31 Jul 2018 16:01:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?BI-25021=E3=80=905.0=E5=88=86=E5=B8=83?= =?UTF-8?q?=E5=BC=8F=E4=B8=80=E8=BD=AE=E3=80=91IE9=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8=EF=BC=8C=E8=B0=83=E6=95=B4=E7=BB=84=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6=EF=BC=8C=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/bundle.js | 50 ++++++++------------------- dist/core.js | 50 ++++++++------------------- dist/fineui.js | 50 ++++++++------------------- dist/utils.js | 50 ++++++++------------------- src/core/utils/detectElementResize.js | 50 ++++++++------------------- 5 files changed, 75 insertions(+), 175 deletions(-) diff --git a/dist/bundle.js b/dist/bundle.js index 3f83923372..03ad34bead 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -22730,36 +22730,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) { @@ -22850,7 +22834,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(); @@ -22869,21 +22854,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); } }; @@ -22898,7 +22878,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 49607e90e4..e9c36c1f8e 100644 --- a/dist/core.js +++ b/dist/core.js @@ -22730,36 +22730,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) { @@ -22850,7 +22834,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(); @@ -22869,21 +22854,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); } }; @@ -22898,7 +22878,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 cdde3a32a4..7ae09688c0 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -22979,36 +22979,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) { @@ -23099,7 +23083,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(); @@ -23118,21 +23103,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); } }; @@ -23147,7 +23127,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 951d4d8db8..dae980b170 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -14506,36 +14506,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) { @@ -14626,7 +14610,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(); @@ -14645,21 +14630,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); } }; @@ -14674,7 +14654,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 7b50d28e81..65d128127d 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); } }; -}()); +})();