|
|
@ -419,8 +419,10 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, { |
|
|
|
if (o.isNeedResizeContainer) { |
|
|
|
if (o.isNeedResizeContainer) { |
|
|
|
|
|
|
|
|
|
|
|
var isResizing = false; |
|
|
|
var isResizing = false; |
|
|
|
|
|
|
|
var needEnd = false; |
|
|
|
var height; |
|
|
|
var height; |
|
|
|
var interval; |
|
|
|
var interval; |
|
|
|
|
|
|
|
var startSize; |
|
|
|
var resize = function (e, ui) { |
|
|
|
var resize = function (e, ui) { |
|
|
|
if (isResizing) { |
|
|
|
if (isResizing) { |
|
|
|
return; |
|
|
|
return; |
|
|
@ -442,20 +444,26 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, { |
|
|
|
minHeight: 20, |
|
|
|
minHeight: 20, |
|
|
|
helper: "bi-resizer", |
|
|
|
helper: "bi-resizer", |
|
|
|
autoHide: true, |
|
|
|
autoHide: true, |
|
|
|
|
|
|
|
start: function (e, ui) { |
|
|
|
|
|
|
|
startSize = BI.clone(ui.size); |
|
|
|
|
|
|
|
}, |
|
|
|
resize: function (e, ui) { |
|
|
|
resize: function (e, ui) { |
|
|
|
if (ui.size.height >= self.arrangement.container.element.height()) { |
|
|
|
if (ui.size.height >= startSize.height - 10) { |
|
|
|
resize(e, ui); |
|
|
|
resize(e, ui); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
interval && clearInterval(interval); |
|
|
|
interval && clearInterval(interval); |
|
|
|
|
|
|
|
needEnd = true; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
stop: function (e, ui) { |
|
|
|
stop: function (e, ui) { |
|
|
|
var size = ui.size; |
|
|
|
var size = ui.size; |
|
|
|
if (isResizing) { |
|
|
|
if (isResizing && !needEnd) { |
|
|
|
size.height = height; |
|
|
|
size.height = height; |
|
|
|
} |
|
|
|
} |
|
|
|
self.arrangement.setContainerSize(ui.size); |
|
|
|
self.arrangement.setContainerSize(ui.size); |
|
|
|
|
|
|
|
needEnd = false; |
|
|
|
isResizing = false; |
|
|
|
isResizing = false; |
|
|
|
|
|
|
|
startSize = null; |
|
|
|
interval && clearInterval(interval); |
|
|
|
interval && clearInterval(interval); |
|
|
|
self.fireEvent(BI.AdaptiveArrangement.EVENT_RESIZE); |
|
|
|
self.fireEvent(BI.AdaptiveArrangement.EVENT_RESIZE); |
|
|
|
} |
|
|
|
} |
|
|
@ -484,17 +492,21 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, { |
|
|
|
return this.arrangement._isEqual.apply(this.arrangement, arguments); |
|
|
|
return this.arrangement._isEqual.apply(this.arrangement, arguments); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_initResizable: function (item) { |
|
|
|
_setSelect: function (item) { |
|
|
|
var self = this, o = this.options; |
|
|
|
|
|
|
|
item.element.css("zIndex", ++this.zIndex); |
|
|
|
|
|
|
|
item.element.mousedown(function () { |
|
|
|
|
|
|
|
if (!item.element.hasClass("selected")) { |
|
|
|
if (!item.element.hasClass("selected")) { |
|
|
|
item.element.css("zIndex", ++self.zIndex); |
|
|
|
item.element.css("zIndex", ++this.zIndex); |
|
|
|
BI.each(self.getAllRegions(), function (i, region) { |
|
|
|
BI.each(this.getAllRegions(), function (i, region) { |
|
|
|
region.el.element.removeClass("selected"); |
|
|
|
region.el.element.removeClass("selected"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
item.element.addClass("selected"); |
|
|
|
item.element.addClass("selected"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_initResizable: function (item) { |
|
|
|
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
|
|
|
item.element.css("zIndex", ++this.zIndex); |
|
|
|
|
|
|
|
item.element.mousedown(function () { |
|
|
|
|
|
|
|
self._setSelect(item) |
|
|
|
}); |
|
|
|
}); |
|
|
|
o.resizable && item.element.resizable({ |
|
|
|
o.resizable && item.element.resizable({ |
|
|
|
handles: "e, s, se", |
|
|
|
handles: "e, s, se", |
|
|
@ -663,6 +675,7 @@ BI.AdaptiveArrangement = BI.inherit(BI.Widget, { |
|
|
|
|
|
|
|
|
|
|
|
addRegion: function (region, position) { |
|
|
|
addRegion: function (region, position) { |
|
|
|
this._initResizable(region.el); |
|
|
|
this._initResizable(region.el); |
|
|
|
|
|
|
|
this._setSelect(region.el); |
|
|
|
var self = this, flag; |
|
|
|
var self = this, flag; |
|
|
|
var old = this.arrangement.getAllRegions(); |
|
|
|
var old = this.arrangement.getAllRegions(); |
|
|
|
if (BI.isNotNull(this.position)) { |
|
|
|
if (BI.isNotNull(this.position)) { |
|
|
|