From 6eebf82e33d6d640bf45cbf8e562567fa482de60 Mon Sep 17 00:00:00 2001 From: Rolux Date: Sun, 21 Feb 2010 11:32:56 +0530 Subject: [PATCH] keep dialog from being resizable beyond document --- build/css/ox.ui.css | 2 +- build/js/ox.ui.js | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/build/css/ox.ui.css b/build/css/ox.ui.css index 6a2ca515..72bccefe 100644 --- a/build/css/ox.ui.css +++ b/build/css/ox.ui.css @@ -62,7 +62,7 @@ Dialog .OxDialog { position: absolute; left: 0; - top: -48px; + top: 0; right: 0; bottom: 0; margin: auto; diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index 9357f33d..b57e4d46 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -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" + }); }); }