diff --git a/bi/widget.js b/bi/widget.js index 05cbb17a13..e8c2ae9acb 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 05cbb17a13..e8c2ae9acb 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 4f168791ab..e446c4ed0a 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 96514ce621..d56a878b13 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 6ed67fa2df..f6d815d82d 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); },