forked from GNUsocial/gnu-social
(Un)Subscribed submit is disabled and greyed out while ajaxForm process
darcs-hash:20081208051212-eefa4-13c2cc5bab8c8da38dff51bce7fe89c2debdb781.gz
This commit is contained in:
parent
6e856cf7ee
commit
7d2f88f935
10
js/util.js
10
js/util.js
@ -94,16 +94,24 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
|
|
||||||
var Subscribe = { dataType: 'xml',
|
var Subscribe = { dataType: 'xml',
|
||||||
|
beforeSubmit: function(formData, jqForm, options) { $("form.subscribe input[type=submit]").attr("disabled", "disabled");
|
||||||
|
$("form.subscribe input[type=submit]").addClass("disabled");
|
||||||
|
},
|
||||||
success: function(xml) { var form_unsubscribe = document._importNode($('form', xml).get(0), true);
|
success: function(xml) { var form_unsubscribe = document._importNode($('form', xml).get(0), true);
|
||||||
var form_unsubscribe_id = form_unsubscribe.id;
|
var form_unsubscribe_id = form_unsubscribe.id;
|
||||||
var form_subscribe_id = form_unsubscribe_id.replace('unsubscribe', 'subscribe');
|
var form_subscribe_id = form_unsubscribe_id.replace('unsubscribe', 'subscribe');
|
||||||
$("form#"+form_subscribe_id).replaceWith(form_unsubscribe);
|
$("form#"+form_subscribe_id).replaceWith(form_unsubscribe);
|
||||||
$("form#"+form_unsubscribe_id).ajaxForm(UnSubscribe).each(addAjaxHidden);
|
$("form#"+form_unsubscribe_id).ajaxForm(UnSubscribe).each(addAjaxHidden);
|
||||||
$("dd.subscribers").text(parseInt($("dd.subscribers").text())+1);
|
$("dd.subscribers").text(parseInt($("dd.subscribers").text())+1);
|
||||||
|
$("form.subscribe input[type=submit]").removeAttr("disabled");
|
||||||
|
$("form.subscribe input[type=submit]").removeClass("disabled");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var UnSubscribe = { dataType: 'xml',
|
var UnSubscribe = { dataType: 'xml',
|
||||||
|
beforeSubmit: function(formData, jqForm, options) { $("form.unsubscribe input[type=submit]").attr("disabled", "disabled");
|
||||||
|
$("form.unsubscribe input[type=submit]").addClass("disabled");
|
||||||
|
},
|
||||||
success: function(xml) { var form_subscribe = document._importNode($('form', xml).get(0), true);
|
success: function(xml) { var form_subscribe = document._importNode($('form', xml).get(0), true);
|
||||||
var form_subscribe_id = form_subscribe.id;
|
var form_subscribe_id = form_subscribe.id;
|
||||||
var form_unsubscribe_id = form_subscribe_id.replace('subscribe', 'unsubscribe');
|
var form_unsubscribe_id = form_subscribe_id.replace('subscribe', 'unsubscribe');
|
||||||
@ -112,6 +120,8 @@ $(document).ready(function(){
|
|||||||
$("#profile_send_a_new_message").remove();
|
$("#profile_send_a_new_message").remove();
|
||||||
$("#profile_nudge").remove();
|
$("#profile_nudge").remove();
|
||||||
$("dd.subscribers").text(parseInt($("dd.subscribers").text())-1);
|
$("dd.subscribers").text(parseInt($("dd.subscribers").text())-1);
|
||||||
|
$("form.unsubscribe input[type=submit]").removeAttr("disabled");
|
||||||
|
$("form.unsubscribe input[type=submit]").removeClass("disabled");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user