[ticket/10291] Fixed a bug in the quick reply AJAX.

It wasn't submitting, as jQuery was ignoring the submit value.

PHPBB3-10291
This commit is contained in:
Callum Macrae 2012-02-19 16:30:22 +00:00 committed by Igor Wiedler
parent e73426fe26
commit ba56e34b6d

View file

@ -251,7 +251,7 @@ phpbb.ajaxify = function(options) {
elements.bind(event_name, function() {
var action, method, data, that = this, $this = $(this);
if (!$this.attr('data-ajax'))
if ($this.find('input[type="submit"][data-clicked]').attr('data-ajax') === 'false')
{
return;
}
@ -358,6 +358,15 @@ phpbb.ajaxify = function(options) {
action = $this.attr('action').replace('&', '&');
data = $this.serializeArray();
method = $this.attr('method') || 'GET';
if ($this.find('input[type="submit"][data-clicked]'))
{
var submit = $this.find('input[type="submit"][data-clicked]');
data.push({
name: submit.attr('name'),
value: submit.val()
});
}
}
else
{
@ -386,6 +395,15 @@ phpbb.ajaxify = function(options) {
return false;
});
if (is_form) {
elements.find('input:submit').click(function () {
var $this = $(this);
$this.siblings('[data-clicked]').removeAttr('data-clicked');
$this.attr('data-clicked', 'true');
});
}
return this;
}