From 4635f5d8876ba602790de373cb87b7d8df4ba29a Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 1 Apr 2017 12:49:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bi/widget.js | 17 +++++++++++++++++ dist/widget.js | 17 +++++++++++++++++ .../adaptivearrangement/adaptivearrangement.js | 4 ++++ src/widget/arrangement/arrangement.js | 9 +++++++++ .../interactivearrangement.js | 4 ++++ 5 files changed, 51 insertions(+) diff --git a/bi/widget.js b/bi/widget.js index b375c5c3a6..d84a560fe5 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -416,6 +416,9 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, { layoutType: o.layoutType, items: o.items }); + this.arrangement.on(BI.Arrangement.EVENT_SCROLL, function () { + self.fireEvent(BI.AdaptiveArrangement.EVENT_SCROLL, arguments); + }); if (o.isNeedResizeContainer) { var isResizing = false; @@ -906,6 +909,7 @@ BI.AdaptiveArrangement.EVENT_ELEMENT_START_RESIZE = "AdaptiveArrangement.EVENT_E BI.AdaptiveArrangement.EVENT_ELEMENT_RESIZE = "AdaptiveArrangement.EVENT_ELEMENT_RESIZE"; BI.AdaptiveArrangement.EVENT_ELEMENT_STOP_RESIZE = "AdaptiveArrangement.EVENT_ELEMENT_STOP_RESIZE"; BI.AdaptiveArrangement.EVENT_RESIZE = "AdaptiveArrangement.EVENT_RESIZE"; +BI.AdaptiveArrangement.EVENT_SCROLL = "AdaptiveArrangement.EVENT_SCROLL"; BI.shortcut('bi.adaptive_arrangement', BI.AdaptiveArrangement);/** * Arrangement的block面板 * @@ -1001,6 +1005,14 @@ BI.Arrangement = BI.inherit(BI.Widget, { scrollable: true, items: [this.container] }); + this.scrollContainer.element.scroll(function () { + self.fireEvent(BI.Arrangement.EVENT_SCROLL, { + scrollLeft: self.scrollContainer.element.scrollLeft(), + scrollTop: self.scrollContainer.element.scrollTop(), + clientWidth: self.scrollContainer.element[0].clientWidth, + clientHeight: self.scrollContainer.element[0].clientHeight + }); + }); BI.createWidget({ type: "bi.adaptive", @@ -3873,6 +3885,7 @@ BI.Arrangement = BI.inherit(BI.Widget, { this._renderRegion(); } }); +BI.Arrangement.EVENT_SCROLL = "EVENT_SCROLL"; BI.extend(BI.Arrangement, { PORTION: 24, GRID_HEIGHT: 50, @@ -7140,6 +7153,9 @@ BI.InteractiveArrangement = BI.inherit(BI.Widget, { layoutType: o.layoutType, items: o.items }); + this.arrangement.on(BI.AdaptiveArrangement.EVENT_SCROLL, function () { + self.fireEvent(BI.InteractiveArrangement.EVENT_SCROLL, arguments); + }); this.arrangement.on(BI.AdaptiveArrangement.EVENT_RESIZE, function () { self.fireEvent(BI.InteractiveArrangement.EVENT_RESIZE, arguments); }); @@ -7677,6 +7693,7 @@ BI.InteractiveArrangement = BI.inherit(BI.Widget, { } }); BI.InteractiveArrangement.EVENT_RESIZE = "InteractiveArrangement.EVENT_RESIZE"; +BI.InteractiveArrangement.EVENT_SCROLL = "InteractiveArrangement.EVENT_SCROLL"; BI.shortcut('bi.interactive_arrangement', BI.InteractiveArrangement);/** * 月份下拉框 * diff --git a/dist/widget.js b/dist/widget.js index b375c5c3a6..d84a560fe5 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -416,6 +416,9 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, { layoutType: o.layoutType, items: o.items }); + this.arrangement.on(BI.Arrangement.EVENT_SCROLL, function () { + self.fireEvent(BI.AdaptiveArrangement.EVENT_SCROLL, arguments); + }); if (o.isNeedResizeContainer) { var isResizing = false; @@ -906,6 +909,7 @@ BI.AdaptiveArrangement.EVENT_ELEMENT_START_RESIZE = "AdaptiveArrangement.EVENT_E BI.AdaptiveArrangement.EVENT_ELEMENT_RESIZE = "AdaptiveArrangement.EVENT_ELEMENT_RESIZE"; BI.AdaptiveArrangement.EVENT_ELEMENT_STOP_RESIZE = "AdaptiveArrangement.EVENT_ELEMENT_STOP_RESIZE"; BI.AdaptiveArrangement.EVENT_RESIZE = "AdaptiveArrangement.EVENT_RESIZE"; +BI.AdaptiveArrangement.EVENT_SCROLL = "AdaptiveArrangement.EVENT_SCROLL"; BI.shortcut('bi.adaptive_arrangement', BI.AdaptiveArrangement);/** * Arrangement的block面板 * @@ -1001,6 +1005,14 @@ BI.Arrangement = BI.inherit(BI.Widget, { scrollable: true, items: [this.container] }); + this.scrollContainer.element.scroll(function () { + self.fireEvent(BI.Arrangement.EVENT_SCROLL, { + scrollLeft: self.scrollContainer.element.scrollLeft(), + scrollTop: self.scrollContainer.element.scrollTop(), + clientWidth: self.scrollContainer.element[0].clientWidth, + clientHeight: self.scrollContainer.element[0].clientHeight + }); + }); BI.createWidget({ type: "bi.adaptive", @@ -3873,6 +3885,7 @@ BI.Arrangement = BI.inherit(BI.Widget, { this._renderRegion(); } }); +BI.Arrangement.EVENT_SCROLL = "EVENT_SCROLL"; BI.extend(BI.Arrangement, { PORTION: 24, GRID_HEIGHT: 50, @@ -7140,6 +7153,9 @@ BI.InteractiveArrangement = BI.inherit(BI.Widget, { layoutType: o.layoutType, items: o.items }); + this.arrangement.on(BI.AdaptiveArrangement.EVENT_SCROLL, function () { + self.fireEvent(BI.InteractiveArrangement.EVENT_SCROLL, arguments); + }); this.arrangement.on(BI.AdaptiveArrangement.EVENT_RESIZE, function () { self.fireEvent(BI.InteractiveArrangement.EVENT_RESIZE, arguments); }); @@ -7677,6 +7693,7 @@ BI.InteractiveArrangement = BI.inherit(BI.Widget, { } }); BI.InteractiveArrangement.EVENT_RESIZE = "InteractiveArrangement.EVENT_RESIZE"; +BI.InteractiveArrangement.EVENT_SCROLL = "InteractiveArrangement.EVENT_SCROLL"; BI.shortcut('bi.interactive_arrangement', BI.InteractiveArrangement);/** * 月份下拉框 * diff --git a/src/widget/adaptivearrangement/adaptivearrangement.js b/src/widget/adaptivearrangement/adaptivearrangement.js index 63f8ff2efd..4f168791ab 100644 --- a/src/widget/adaptivearrangement/adaptivearrangement.js +++ b/src/widget/adaptivearrangement/adaptivearrangement.js @@ -34,6 +34,9 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, { layoutType: o.layoutType, items: o.items }); + this.arrangement.on(BI.Arrangement.EVENT_SCROLL, function () { + self.fireEvent(BI.AdaptiveArrangement.EVENT_SCROLL, arguments); + }); if (o.isNeedResizeContainer) { var isResizing = false; @@ -524,4 +527,5 @@ BI.AdaptiveArrangement.EVENT_ELEMENT_START_RESIZE = "AdaptiveArrangement.EVENT_E BI.AdaptiveArrangement.EVENT_ELEMENT_RESIZE = "AdaptiveArrangement.EVENT_ELEMENT_RESIZE"; BI.AdaptiveArrangement.EVENT_ELEMENT_STOP_RESIZE = "AdaptiveArrangement.EVENT_ELEMENT_STOP_RESIZE"; BI.AdaptiveArrangement.EVENT_RESIZE = "AdaptiveArrangement.EVENT_RESIZE"; +BI.AdaptiveArrangement.EVENT_SCROLL = "AdaptiveArrangement.EVENT_SCROLL"; BI.shortcut('bi.adaptive_arrangement', BI.AdaptiveArrangement); \ No newline at end of file diff --git a/src/widget/arrangement/arrangement.js b/src/widget/arrangement/arrangement.js index da80c75254..92cb60d112 100644 --- a/src/widget/arrangement/arrangement.js +++ b/src/widget/arrangement/arrangement.js @@ -51,6 +51,14 @@ BI.Arrangement = BI.inherit(BI.Widget, { scrollable: true, items: [this.container] }); + this.scrollContainer.element.scroll(function () { + self.fireEvent(BI.Arrangement.EVENT_SCROLL, { + scrollLeft: self.scrollContainer.element.scrollLeft(), + scrollTop: self.scrollContainer.element.scrollTop(), + clientWidth: self.scrollContainer.element[0].clientWidth, + clientHeight: self.scrollContainer.element[0].clientHeight + }); + }); BI.createWidget({ type: "bi.adaptive", @@ -2923,6 +2931,7 @@ BI.Arrangement = BI.inherit(BI.Widget, { this._renderRegion(); } }); +BI.Arrangement.EVENT_SCROLL = "EVENT_SCROLL"; BI.extend(BI.Arrangement, { PORTION: 24, GRID_HEIGHT: 50, diff --git a/src/widget/interactivearrangement/interactivearrangement.js b/src/widget/interactivearrangement/interactivearrangement.js index d2897c4c92..6ed67fa2df 100644 --- a/src/widget/interactivearrangement/interactivearrangement.js +++ b/src/widget/interactivearrangement/interactivearrangement.js @@ -31,6 +31,9 @@ BI.InteractiveArrangement = BI.inherit(BI.Widget, { layoutType: o.layoutType, items: o.items }); + this.arrangement.on(BI.AdaptiveArrangement.EVENT_SCROLL, function () { + self.fireEvent(BI.InteractiveArrangement.EVENT_SCROLL, arguments); + }); this.arrangement.on(BI.AdaptiveArrangement.EVENT_RESIZE, function () { self.fireEvent(BI.InteractiveArrangement.EVENT_RESIZE, arguments); }); @@ -568,4 +571,5 @@ BI.InteractiveArrangement = BI.inherit(BI.Widget, { } }); BI.InteractiveArrangement.EVENT_RESIZE = "InteractiveArrangement.EVENT_RESIZE"; +BI.InteractiveArrangement.EVENT_SCROLL = "InteractiveArrangement.EVENT_SCROLL"; BI.shortcut('bi.interactive_arrangement', BI.InteractiveArrangement); \ No newline at end of file