diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2008-12-16 19:06:03 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2008-12-16 19:06:03 +0000 |
commit | 59bc7dc22c650e731ae3db1f5d6df0d05a389191 (patch) | |
tree | 77880969e3a197de7005d524202d83606212a8aa | |
parent | 04441e11cccceea92454d3fcbc54e0e103fb8bd6 (diff) |
1) change the selector for the the function to gDialog
2) Once the dialog is resized, center it
-rw-r--r-- | modules/watermark/views/watermark_position.html.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/watermark/views/watermark_position.html.php b/modules/watermark/views/watermark_position.html.php index 663be90f..2cf10a79 100644 --- a/modules/watermark/views/watermark_position.html.php +++ b/modules/watermark/views/watermark_position.html.php @@ -1,6 +1,5 @@ <script> -$("#gWatermarkAdmin").ready(function() { - +$("#gDialog").ready(function() { var container = $("#gDialog").parent().parent(); var container_height = $(container).attr("offsetHeight"); var container_width = $(container).attr("offsetWidth"); @@ -8,8 +7,12 @@ $("#gWatermarkAdmin").ready(function() { var new_height = $("#gDialog").attr("offsetHeight") + container.find("div.ui-dialog-titlebar").attr("offsetHeight") + container.find("div.ui-dialog-buttonpane").attr("offsetHeight"); - container.css("height", Math.max(new_height, container_height) + "px"); - container.css("width", Math.max($("#gDialog").attr("offsetWidth"), container_width) + "px"); + var height = Math.max(new_height, container_height); + var width = Math.max($("#gDialog").attr("offsetWidth"), container_width); + container.css("height", height + "px"); + container.css("width", width + "px"); + container.css("top", ((document.height - height) / 2) + "px"); + container.css("left", ((document.width - width) / 2) + "px"); }); </script> <div id="gWatermarkAdmin"> |