From 7569b39802a855da92ebc1fd78a6343e7715746b Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Sat, 10 Jan 2009 06:25:44 +0000 Subject: Updated to jquery ui 1.6rc4. Lots of changes, improved widget theme css and icons. No need to fix position dialogs anymore. Included the following in the combined file + i18n files. Requires push back up to vendor branch. UI Core Effects Core Draggable - Req'd by Sortable Resizeable - Image/watermark/avatar scaling Sortable - Rearrange Dialog - All over :) Datepicker - Edit albums/items Progressbar Highlight - Message display, comment addition Transfer - Adding tags from available list to field Not fully integrated into the default theme yet. --- lib/gallery.dialog.js | 50 ++++++++++++++++++++++---------------------------- 1 file changed, 22 insertions(+), 28 deletions(-) (limited to 'lib/gallery.dialog.js') diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js index 175f2a42..a3da41e3 100644 --- a/lib/gallery.dialog.js +++ b/lib/gallery.dialog.js @@ -17,7 +17,6 @@ function handleDialogEvent(event) { * @requires ui.dialog * @see handleDialogEvent() * - * @todo Set ui-dialog-buttonpane button values equal to the original form button value * @todo Display loading animation on form submit */ function openDialog(element, on_success) { @@ -28,7 +27,7 @@ function openDialog(element, on_success) { $("body").append(eDialog); $("#gDialog").dialog({ autoOpen: false, - autoResize: false, + autoResize: true, draggable: true, height: "auto", width: "auto", @@ -42,10 +41,10 @@ function openDialog(element, on_success) { $("#gDialog").dialog("destroy").remove(); } }); - loading("#gDialog"); + showLoading("#gDialog"); $("#gDialog").html(sHref); $.get(sHref, function(data) { - loading("#gDialog"); + showLoading("#gDialog"); $("#gDialog").html(data); var parent = $("#gDialog").parent().parent(); parent.css("opacity", "0.0"); @@ -54,31 +53,26 @@ function openDialog(element, on_success) { if (parent.width() < 400) { parent.css("width", 400); } - parent.css({"position": "fixed", - "top": $(window).height() / 2 - parent.height() / 2, - "left": $(window).width() / 2 - parent.width() / 2, - "opacity": "1.0" - }); - + parent.css({"opacity": "1.0"}); ajaxify_dialog = function() { $("#gDialog form").ajaxForm({ - dataType: "json", - success: function(data) { - if (data.form) { - $("#gDialog form").replaceWith(data.form); - ajaxify_dialog(); - } - if (data.result == "success") { - $("#gDialog").dialog("close"); - if (on_success) { - on_success(); - } else if (data.location) { - window.location = data.location; - } else { - window.location.reload(); - } - } - } + dataType: "json", + success: function(data) { + if (data.form) { + $("#gDialog form").replaceWith(data.form); + ajaxify_dialog(); + } + if (data.result == "success") { + $("#gDialog").dialog("close"); + if (on_success) { + on_success(); + } else if (data.location) { + window.location = data.location; + } else { + window.location.reload(); + } + } + } }); }; ajaxify_dialog(); @@ -91,7 +85,7 @@ function openDialog(element, on_success) { * * @param element ID to which to apply the loading class, including # */ -function loading(element) { +function showLoading(element) { var size; switch (element) { case "#gDialog": -- cgit v1.2.3