1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-29 10:39:19 +02:00

[ticket/10291] AJAXified quick reply form.

Also changed the show quick reply button to a button, not a submit - it was
affecting the behaviour of phpbb.ajaxify.

PHPBB3-10291
This commit is contained in:
Callum Macrae 2011-07-25 10:59:19 +01:00 committed by Igor Wiedler
parent 57fa45b0c4
commit b9bbbc3ede
2 changed files with 16 additions and 3 deletions

View File

@ -1,4 +1,4 @@
<form method="post" action="{U_QR_ACTION}">
<form method="post" action="{U_QR_ACTION}" data-ajax="qr-submit" data-refresh="true">
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<h2>{L_QUICKREPLY}</h2>
@ -15,7 +15,7 @@
{S_FORM_TOKEN}
{QR_HIDDEN_FIELDS}
<input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1" />&nbsp;
<input type="submit" accesskey="f" tabindex="7" name="full_editor" value="{L_FULL_EDITOR}" class="button2" />&nbsp;
<input type="submit" accesskey="f" tabindex="7" name="full_editor" value="{L_FULL_EDITOR}" class="button2" data-ajax="false" />&nbsp;
</fieldset>
<span class="corners-bottom"><span></span></span></div>
</div>

View File

@ -103,6 +103,11 @@ phpbb.ajaxify = function(options, refresh, callback) {
$(selector).click(function() {
var act, data, path, that = this;
if ($(this).data('ajax') == false)
{
return true;
}
function return_handler(res)
{
res = JSON.parse(res);
@ -157,7 +162,11 @@ phpbb.ajaxify = function(options, refresh, callback) {
act = act[1]
data += '&action=' + act;
}
else
{
data += '&' + this.name + '=' + this.value;
}
if (run_exception && options.exception($(this).parents('form'), act, data))
{
return true;
@ -213,6 +222,10 @@ phpbb.add_ajax_callback('post_delete', function(el) {
$(el).parents((act === 'approve') ? '.rules' : '.post').fadeOut(function() {
$(this).remove();
});
}).add_ajax_callback('qr-submit', function(el) {
$(el).parents('form').fadeOut(function() {
$(this).remove();
});
});