EasyUI Forum

General Category => Bug Report => Topic started by: hjzhbb7758 on July 04, 2018, 02:06:54 AM



Title: Out of bounds when the desktop window moves
Post by: hjzhbb7758 on July 04, 2018, 02:06:54 AM
Code:
onMove: function(left,top){
var opt = $(this).window('options');
app.left = opt.left;
app.top = opt.top;
if (left < 0) {
$(this).window('move', {
left : 1
});
}
if (top < 0) {
$(this).window('move', {
top : 1
});
}
var width = parseInt($(this).parent().css('width'));
var height = parseInt($(this).parent().css('height'));
var parentWidth = $(window).width();
var parentHeight = $(window).height();


if (left > parentWidth - width) {
$(this).window('move', {
"left" : parentWidth - width
});
}
if (top > parentHeight - height) {
$(this).window('move', {
"top" : parentHeight - 45 - height
});
}
}