From 26b3daab12794f0a534cc604968150d3881d820c Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 12 Jun 2017 12:57:45 +0800 Subject: [PATCH] update --- bi/widget.js | 23 ++++++++++++++----- docs/widget.js | 23 ++++++++++++++----- .../adaptivearrangement.js | 8 +++++-- src/widget/arrangement/arrangement.js | 11 +++++---- .../interactivearrangement.js | 4 ++++ 5 files changed, 51 insertions(+), 18 deletions(-) diff --git a/bi/widget.js b/bi/widget.js index 05cbb17a1..e8c2ae9ac 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -475,8 +475,8 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, { width: ui.size.width, height: height }); - self.arrangement.scrollTo(height); - }, 500); + self.arrangement.scrollTo({top: height}); + }, 300); }; this.arrangement.container.element.resizable({ handles: "s", @@ -879,6 +879,10 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, { return this.arrangement.setRegionPosition(name, position); }, + scrollTo: function (scroll) { + this.arrangement.scrollTo(scroll); + }, + zoom: function (ratio) { this.arrangement.zoom(ratio); }, @@ -1205,7 +1209,8 @@ BI.Arrangement = BI.inherit(BI.Widget, { findBottomRegions.push(region); } }); - var topValid = isRegionsValid(findTopRegions, "top"), bottomValid = isRegionsValid(findBottomRegions, "bottom"); + var topValid = isRegionsValid(findTopRegions, "top"), + bottomValid = isRegionsValid(findBottomRegions, "bottom"); if (topValid && bottomValid) { BI.each(findTopRegions, function (i, region) { var clone = BI.clone(region); @@ -1248,7 +1253,8 @@ BI.Arrangement = BI.inherit(BI.Widget, { findRightRegions.push(region); } }); - var leftValid = isRegionsValid(findLeftRegions, "left"), rightValid = isRegionsValid(findRightRegions, "right"); + var leftValid = isRegionsValid(findLeftRegions, "left"), + rightValid = isRegionsValid(findRightRegions, "right"); if (leftValid && rightValid) { BI.each(findLeftRegions, function (i, region) { var clone = BI.clone(region); @@ -3679,8 +3685,9 @@ BI.Arrangement = BI.inherit(BI.Widget, { this.resize(); }, - scrollTo: function (top) { - this.scrollContainer.element.scrollTop(top); + scrollTo: function (scroll) { + this.scrollContainer.element.scrollTop(scroll.top); + this.scrollContainer.element.scrollLeft(scroll.left); }, zoom: function (ratio) { @@ -7682,6 +7689,10 @@ BI.InteractiveArrangement = BI.inherit(BI.Widget, { return this.arrangement.setRegionPosition(name, position); }, + scrollTo: function (scroll) { + this.arrangement.scrollTo(scroll); + }, + zoom: function (ratio) { this.arrangement.zoom(ratio); }, diff --git a/docs/widget.js b/docs/widget.js index 05cbb17a1..e8c2ae9ac 100644 --- a/docs/widget.js +++ b/docs/widget.js @@ -475,8 +475,8 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, { width: ui.size.width, height: height }); - self.arrangement.scrollTo(height); - }, 500); + self.arrangement.scrollTo({top: height}); + }, 300); }; this.arrangement.container.element.resizable({ handles: "s", @@ -879,6 +879,10 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, { return this.arrangement.setRegionPosition(name, position); }, + scrollTo: function (scroll) { + this.arrangement.scrollTo(scroll); + }, + zoom: function (ratio) { this.arrangement.zoom(ratio); }, @@ -1205,7 +1209,8 @@ BI.Arrangement = BI.inherit(BI.Widget, { findBottomRegions.push(region); } }); - var topValid = isRegionsValid(findTopRegions, "top"), bottomValid = isRegionsValid(findBottomRegions, "bottom"); + var topValid = isRegionsValid(findTopRegions, "top"), + bottomValid = isRegionsValid(findBottomRegions, "bottom"); if (topValid && bottomValid) { BI.each(findTopRegions, function (i, region) { var clone = BI.clone(region); @@ -1248,7 +1253,8 @@ BI.Arrangement = BI.inherit(BI.Widget, { findRightRegions.push(region); } }); - var leftValid = isRegionsValid(findLeftRegions, "left"), rightValid = isRegionsValid(findRightRegions, "right"); + var leftValid = isRegionsValid(findLeftRegions, "left"), + rightValid = isRegionsValid(findRightRegions, "right"); if (leftValid && rightValid) { BI.each(findLeftRegions, function (i, region) { var clone = BI.clone(region); @@ -3679,8 +3685,9 @@ BI.Arrangement = BI.inherit(BI.Widget, { this.resize(); }, - scrollTo: function (top) { - this.scrollContainer.element.scrollTop(top); + scrollTo: function (scroll) { + this.scrollContainer.element.scrollTop(scroll.top); + this.scrollContainer.element.scrollLeft(scroll.left); }, zoom: function (ratio) { @@ -7682,6 +7689,10 @@ BI.InteractiveArrangement = BI.inherit(BI.Widget, { return this.arrangement.setRegionPosition(name, position); }, + scrollTo: function (scroll) { + this.arrangement.scrollTo(scroll); + }, + zoom: function (ratio) { this.arrangement.zoom(ratio); }, diff --git a/src/widget/adaptivearrangement/adaptivearrangement.js b/src/widget/adaptivearrangement/adaptivearrangement.js index 4f168791a..e446c4ed0 100644 --- a/src/widget/adaptivearrangement/adaptivearrangement.js +++ b/src/widget/adaptivearrangement/adaptivearrangement.js @@ -56,8 +56,8 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, { width: ui.size.width, height: height }); - self.arrangement.scrollTo(height); - }, 500); + self.arrangement.scrollTo({top: height}); + }, 300); }; this.arrangement.container.element.resizable({ handles: "s", @@ -460,6 +460,10 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, { return this.arrangement.setRegionPosition(name, position); }, + scrollTo: function (scroll) { + this.arrangement.scrollTo(scroll); + }, + zoom: function (ratio) { this.arrangement.zoom(ratio); }, diff --git a/src/widget/arrangement/arrangement.js b/src/widget/arrangement/arrangement.js index 96514ce62..d56a878b1 100644 --- a/src/widget/arrangement/arrangement.js +++ b/src/widget/arrangement/arrangement.js @@ -214,7 +214,8 @@ BI.Arrangement = BI.inherit(BI.Widget, { findBottomRegions.push(region); } }); - var topValid = isRegionsValid(findTopRegions, "top"), bottomValid = isRegionsValid(findBottomRegions, "bottom"); + var topValid = isRegionsValid(findTopRegions, "top"), + bottomValid = isRegionsValid(findBottomRegions, "bottom"); if (topValid && bottomValid) { BI.each(findTopRegions, function (i, region) { var clone = BI.clone(region); @@ -257,7 +258,8 @@ BI.Arrangement = BI.inherit(BI.Widget, { findRightRegions.push(region); } }); - var leftValid = isRegionsValid(findLeftRegions, "left"), rightValid = isRegionsValid(findRightRegions, "right"); + var leftValid = isRegionsValid(findLeftRegions, "left"), + rightValid = isRegionsValid(findRightRegions, "right"); if (leftValid && rightValid) { BI.each(findLeftRegions, function (i, region) { var clone = BI.clone(region); @@ -2688,8 +2690,9 @@ BI.Arrangement = BI.inherit(BI.Widget, { this.resize(); }, - scrollTo: function (top) { - this.scrollContainer.element.scrollTop(top); + scrollTo: function (scroll) { + this.scrollContainer.element.scrollTop(scroll.top); + this.scrollContainer.element.scrollLeft(scroll.left); }, zoom: function (ratio) { diff --git a/src/widget/interactivearrangement/interactivearrangement.js b/src/widget/interactivearrangement/interactivearrangement.js index 6ed67fa2d..f6d815d82 100644 --- a/src/widget/interactivearrangement/interactivearrangement.js +++ b/src/widget/interactivearrangement/interactivearrangement.js @@ -525,6 +525,10 @@ BI.InteractiveArrangement = BI.inherit(BI.Widget, { return this.arrangement.setRegionPosition(name, position); }, + scrollTo: function (scroll) { + this.arrangement.scrollTo(scroll); + }, + zoom: function (ratio) { this.arrangement.zoom(ratio); },