diff --git a/bi/widget.js b/bi/widget.js index 6086679f0d..2baaec1b17 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -600,8 +600,8 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, { return this.arrangement.setRegionPosition(name, position); }, - setDropPosition: function (position) { - return this.arrangement.setDropPosition(position); + setDropPosition: function (position, size) { + return this.arrangement.setDropPosition(position, size); }, scrollInterval: function (e, isBorderScroll, isOverflowScroll, cb) { @@ -1661,10 +1661,10 @@ BI.Arrangement = BI.inherit(BI.Widget, { } }, - setDropPosition: function (position) { + setDropPosition: function (position, size) { var self = this; this.arrangement.setVisible(true); - this._setArrangeSize(position); + this._setArrangeSize(BI.extend({}, position, size)); return function () { self.arrangement.setVisible(false); } @@ -5568,8 +5568,24 @@ BI.InteractiveArrangement = BI.inherit(BI.Widget, { return this.arrangement.setRegionPosition(name, position); }, - setDropPosition: function (position) { - return this.arrangement.setDropPosition(position); + setDropPosition: function (position, size) { + var self = this; + this.stopDraw(); + if (position.left > 0 && position.top > 0) { + switch (this.getLayoutType()) { + case BI.Arrangement.LAYOUT_TYPE.FREE: + position = this.getPosition(null, position, size); + this.draw(position, size); + break; + case BI.Arrangement.LAYOUT_TYPE.GRID: + break; + } + } + var callback = self.arrangement.setDropPosition(position, size); + return function () { + callback(); + self.stopDraw(); + } }, scrollInterval: function () { diff --git a/docs/widget.js b/docs/widget.js index 6086679f0d..2baaec1b17 100644 --- a/docs/widget.js +++ b/docs/widget.js @@ -600,8 +600,8 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, { return this.arrangement.setRegionPosition(name, position); }, - setDropPosition: function (position) { - return this.arrangement.setDropPosition(position); + setDropPosition: function (position, size) { + return this.arrangement.setDropPosition(position, size); }, scrollInterval: function (e, isBorderScroll, isOverflowScroll, cb) { @@ -1661,10 +1661,10 @@ BI.Arrangement = BI.inherit(BI.Widget, { } }, - setDropPosition: function (position) { + setDropPosition: function (position, size) { var self = this; this.arrangement.setVisible(true); - this._setArrangeSize(position); + this._setArrangeSize(BI.extend({}, position, size)); return function () { self.arrangement.setVisible(false); } @@ -5568,8 +5568,24 @@ BI.InteractiveArrangement = BI.inherit(BI.Widget, { return this.arrangement.setRegionPosition(name, position); }, - setDropPosition: function (position) { - return this.arrangement.setDropPosition(position); + setDropPosition: function (position, size) { + var self = this; + this.stopDraw(); + if (position.left > 0 && position.top > 0) { + switch (this.getLayoutType()) { + case BI.Arrangement.LAYOUT_TYPE.FREE: + position = this.getPosition(null, position, size); + this.draw(position, size); + break; + case BI.Arrangement.LAYOUT_TYPE.GRID: + break; + } + } + var callback = self.arrangement.setDropPosition(position, size); + return function () { + callback(); + self.stopDraw(); + } }, scrollInterval: function () { diff --git a/src/widget/adaptivearrangement/adaptivearrangement.js b/src/widget/adaptivearrangement/adaptivearrangement.js index 4eabf7e9d5..d14817e964 100644 --- a/src/widget/adaptivearrangement/adaptivearrangement.js +++ b/src/widget/adaptivearrangement/adaptivearrangement.js @@ -181,8 +181,8 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, { return this.arrangement.setRegionPosition(name, position); }, - setDropPosition: function (position) { - return this.arrangement.setDropPosition(position); + setDropPosition: function (position, size) { + return this.arrangement.setDropPosition(position, size); }, scrollInterval: function (e, isBorderScroll, isOverflowScroll, cb) { diff --git a/src/widget/arrangement/arrangement.js b/src/widget/arrangement/arrangement.js index c2a7754e45..c44ca8defa 100644 --- a/src/widget/arrangement/arrangement.js +++ b/src/widget/arrangement/arrangement.js @@ -867,10 +867,10 @@ BI.Arrangement = BI.inherit(BI.Widget, { } }, - setDropPosition: function (position) { + setDropPosition: function (position, size) { var self = this; this.arrangement.setVisible(true); - this._setArrangeSize(position); + this._setArrangeSize(BI.extend({}, position, size)); return function () { self.arrangement.setVisible(false); } diff --git a/src/widget/interactivearrangement/interactivearrangement.js b/src/widget/interactivearrangement/interactivearrangement.js index ad702ad4a7..aada85b77e 100644 --- a/src/widget/interactivearrangement/interactivearrangement.js +++ b/src/widget/interactivearrangement/interactivearrangement.js @@ -512,8 +512,24 @@ BI.InteractiveArrangement = BI.inherit(BI.Widget, { return this.arrangement.setRegionPosition(name, position); }, - setDropPosition: function (position) { - return this.arrangement.setDropPosition(position); + setDropPosition: function (position, size) { + var self = this; + this.stopDraw(); + if (position.left > 0 && position.top > 0) { + switch (this.getLayoutType()) { + case BI.Arrangement.LAYOUT_TYPE.FREE: + position = this.getPosition(null, position, size); + this.draw(position, size); + break; + case BI.Arrangement.LAYOUT_TYPE.GRID: + break; + } + } + var callback = self.arrangement.setDropPosition(position, size); + return function () { + callback(); + self.stopDraw(); + } }, scrollInterval: function () {