making dialog stay centered

This commit is contained in:
Rolux 2010-02-21 11:04:17 +05:30
parent 40f8576c3a
commit 29c91de2fa
2 changed files with 13 additions and 2 deletions

View file

@ -61,6 +61,11 @@ Dialog
.OxDialog { .OxDialog {
position: absolute; position: absolute;
left: 0;
top: -48px;
right: 0;
bottom: 0;
margin: auto;
-moz-border-radius: 8px; -moz-border-radius: 8px;
-webkit-border-radius: 8px; -webkit-border-radius: 8px;
} }

View file

@ -1252,8 +1252,8 @@ requires
.options(options || {}) .options(options || {})
.addClass("OxDialog") .addClass("OxDialog")
.css({ .css({
left: (($document.width() - self.options.width) / 2) + "px", //left: (($document.width() - self.options.width) / 2) + "px",
top: (($document.height() - self.options.height - 80) / 2) + "px", //top: (($document.height() - self.options.height - 80) / 2) + "px",
width: self.options.width + "px", width: self.options.width + "px",
height: (self.options.height + 80) + "px" height: (self.options.height + 80) + "px"
}); });
@ -1316,6 +1316,9 @@ requires
x = event.clientX, x = event.clientX,
y = event.clientY; y = event.clientY;
$window.mousemove(function(event) { $window.mousemove(function(event) {
that.css({
margin: 0
});
$("*").css({ $("*").css({
WebkitUserSelect: "none" WebkitUserSelect: "none"
}); });
@ -1350,6 +1353,9 @@ requires
x = event.clientX, x = event.clientX,
y = event.clientY; y = event.clientY;
$window.mousemove(function(event) { $window.mousemove(function(event) {
that.css({
margin: 0
});
var width = Ox.limit( var width = Ox.limit(
elementWidth - x + event.clientX, elementWidth - x + event.clientX,
self.options.minWidth, documentWidth self.options.minWidth, documentWidth