summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/organize/js/organize.js16
-rw-r--r--modules/organize/views/organize_dialog.html.php4
2 files changed, 8 insertions, 12 deletions
diff --git a/modules/organize/js/organize.js b/modules/organize/js/organize.js
index 6b4a5934..853e3eef 100644
--- a/modules/organize/js/organize.js
+++ b/modules/organize/js/organize.js
@@ -4,21 +4,19 @@
* Dynamically initialize the organize dialog when it is displayed
*/
init: function(data) {
- // Resize with 50 pixels padding all around
- var size = $.getViewportSize();
- $("#gDialog").dialog("option", "height", size.height() - 100)
- .dialog("option", "width", size.width() - 100)
- .dialog("option", "position", "center");
-
// Deal with ui.jquery bug: http://dev.jqueryui.com/ticket/4475 (target 1.8?)
$(".sf-menu li.sfHover ul").css("z-index", 70);
- var height = $("#gOrganizeDetail").innerHeight();
- $("#gMicroThumbPanel").height(height - $("#gOrganizeEditDrawerHandle").outerHeight());
+ $("#gDialog").bind("dialogopen", function(event, ui) {
+ $("#gMicroThumbPanel").height($("#gDialog").innerHeight() - 90);
+ });
+
+ $("#gDialog").bind("dialogclose", function(event, ui) {
+ window.location.reload();
+ });
$("#gDialog #gMicroThumbDone").click(function(event) {
$("#gDialog").dialog("close");
- window.location.reload();
});
$(".gBranchText span").click($.organize.collapse_or_expand_tree);
diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php
index 6001e038..0daa328d 100644
--- a/modules/organize/views/organize_dialog.html.php
+++ b/modules/organize/views/organize_dialog.html.php
@@ -41,7 +41,5 @@
<script type="text/javascript" src="<?= url::file("modules/organize/js/organize.js") ?>"></script>
<script type="text/javascript">
- setTimeout(function() {
- $.organize.init();
- }, 0);
+ $("#gOrganize").ready($.organize.init);
</script>