keep dialog from being resizable beyond document

This commit is contained in:
Rolux 2010-02-21 11:32:56 +05:30
parent 4eb9898216
commit 5e10355c1a
2 changed files with 13 additions and 6 deletions

View File

@ -62,7 +62,7 @@ Dialog
.OxDialog {
position: absolute;
left: 0;
top: -48px;
top: 0;
right: 0;
bottom: 0;
margin: auto;

View File

@ -1254,6 +1254,7 @@ requires
.css({
//left: (($document.width() - self.options.width) / 2) + "px",
//top: (($document.height() - self.options.height - 80) / 2) + "px",
top: parseInt(-$document.height() / 10) + "px",
width: self.options.width + "px",
height: self.options.height + "px"
});
@ -1316,12 +1317,12 @@ requires
x = event.clientX,
y = event.clientY;
$window.mousemove(function(event) {
that.css({
margin: 0
});
$("*").css({
WebkitUserSelect: "none"
});
that.css({
margin: 0
});
var left = Ox.limit(
offset.left - x + event.clientX,
24 - self.options.width, documentWidth - 24
@ -1354,6 +1355,9 @@ requires
x = event.clientX,
y = event.clientY;
$window.mousemove(function(event) {
$("*").css({
WebkitUserSelect: "none"
});
that.css({
left: offset.left,
top: offset.top,
@ -1361,11 +1365,11 @@ requires
});
var width = Ox.limit(
elementWidth - x + event.clientX,
self.options.minWidth, documentWidth
self.options.minWidth, documentWidth - offset.left
),
height = Ox.limit(
elementHeight - y + event.clientY,
self.options.minHeight, documentHeight
self.options.minHeight, documentHeight - offset.top
);
that.width(width);
that.height(height);
@ -1373,6 +1377,9 @@ requires
});
$window.one("mouseup", function() {
$window.unbind("mousemove");
$("*").css({
WebkitUserSelect: "auto"
});
});
}