diff options
author | Callum Macrae <callum@lynxphp.com> | 2012-02-19 16:30:22 +0000 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2012-03-31 02:10:15 +0200 |
commit | ba56e34b6de6e57edb2b0db66ff3ca4e2081a7ea (patch) | |
tree | f19c40897b2a92868e9d41edf840f6a5cd6478d2 /phpBB/assets | |
parent | e73426fe267a13e2964273e31391dcd93e50ad1b (diff) | |
download | forums-ba56e34b6de6e57edb2b0db66ff3ca4e2081a7ea.tar forums-ba56e34b6de6e57edb2b0db66ff3ca4e2081a7ea.tar.gz forums-ba56e34b6de6e57edb2b0db66ff3ca4e2081a7ea.tar.bz2 forums-ba56e34b6de6e57edb2b0db66ff3ca4e2081a7ea.tar.xz forums-ba56e34b6de6e57edb2b0db66ff3ca4e2081a7ea.zip |
[ticket/10291] Fixed a bug in the quick reply AJAX.
It wasn't submitting, as jQuery was ignoring the submit value.
PHPBB3-10291
Diffstat (limited to 'phpBB/assets')
-rw-r--r-- | phpBB/assets/javascript/core.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index eb9798331e..bed25b5beb 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -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; } |