summaryrefslogtreecommitdiff
path: root/themes/admin_default/js/ui.init.js
diff options
context:
space:
mode:
authorChad Kieffer <chad@2tbsp.com>2009-02-03 06:45:43 +0000
committerChad Kieffer <chad@2tbsp.com>2009-02-03 06:45:43 +0000
commitd656b6a3e61ac7d32607638ddd125457813b0616 (patch)
tree014c52e53356a63d9eab7d0c3a1296b7166f7d29 /themes/admin_default/js/ui.init.js
parent150a90dabd333fc5ed6daa8f725913bbeef19b42 (diff)
Beginning of edit user panel fix. Form is displayed again. Added display of user email address to list.
Diffstat (limited to 'themes/admin_default/js/ui.init.js')
-rw-r--r--themes/admin_default/js/ui.init.js71
1 files changed, 35 insertions, 36 deletions
diff --git a/themes/admin_default/js/ui.init.js b/themes/admin_default/js/ui.init.js
index 80ca2342..04b7ab0c 100644
--- a/themes/admin_default/js/ui.init.js
+++ b/themes/admin_default/js/ui.init.js
@@ -44,49 +44,48 @@ function handlePanelEvent(event) {
function togglePanel(element, on_success) {
var parent = $(element).parent().parent();
var sHref = $(element).attr("href");
- var ePanel = '<div id="gPanel"></div>';
+ var parentClass = $(parent).attr("class");
+ var ePanel = '<tr id="gPanel"><td colspan="6"></td></tr>';
if ($("#gPanel").length) {
$("#gPanel").slideUp("slow");
$("#gPanel *").remove();
$("#gPanel").remove();
- }
-
- $(parent).append(ePanel);
-
- var panel = $(parent).children("#gPanel");
-
- showLoading("#gPanel");
-
- $(panel).html(sHref);
- panel.show().slideDown("slow");
-
- $.get(sHref, function(data) {
- $(panel).html(data);
- ajaxify_panel = function() {
- $("#gPanel form").ajaxForm({
- dataType: "json",
- success: function(data) {
- if (data.form) {
- $("#gPanel form").replaceWith(data.form);
- ajaxify_panel();
- }
- if (data.result == "success") {
- if (on_success) {
- on_success();
- } else if (data.location) {
- window.location = data.location;
- } else {
- window.location.reload();
+ console.log("Removing existing #gPanel");
+ //togglePanel(element, on_success);
+ } else {
+ console.log("Adding #gPanel");
+ $(parent).after(ePanel);
+ //showLoading("#here");
+ $("#gPanel td").html(sHref);
+ $("#gPanel").addClass(parentClass).show().slideDown("slow");
+ $.get(sHref, function(data) {
+ $("#gPanel td").html(data);
+ ajaxify_panel = function() {
+ $("#gPanel td form").ajaxForm({
+ dataType: "json",
+ success: function(data) {
+ if (data.form) {
+ $("#gPanel td form").replaceWith(data.form);
+ ajaxify_panel();
+ }
+ if (data.result == "success") {
+ if (on_success) {
+ on_success();
+ } else if (data.location) {
+ window.location = data.location;
+ } else {
+ window.location.reload();
+ }
}
}
+ });
+ if ($("#gPanel td").hasClass("gLoadingLarge")) {
+ showLoading("#gPanel td");
}
- });
- if ($("#gPanel").hasClass("gLoadingLarge")) {
- showLoading("#gPanel");
- }
- };
- ajaxify_panel();
- });
+ };
+ ajaxify_panel();
+ });
+ }
return false;
}