diff options
| author | Callum Macrae <callum@lynxphp.com> | 2011-10-22 16:16:15 +0100 |
|---|---|---|
| committer | Igor Wiedler <igor@wiedler.ch> | 2012-03-31 02:09:19 +0200 |
| commit | 1c5b1ede1c35d57e9abfb62bdee145828011b1b0 (patch) | |
| tree | b91c2c5c57a4ecc0057cdd67f9d909a08bbf10f4 /phpBB/styles/prosilver | |
| parent | 7f338971542424a85242287758f752f4f873e7f3 (diff) | |
| download | forums-1c5b1ede1c35d57e9abfb62bdee145828011b1b0.tar forums-1c5b1ede1c35d57e9abfb62bdee145828011b1b0.tar.gz forums-1c5b1ede1c35d57e9abfb62bdee145828011b1b0.tar.bz2 forums-1c5b1ede1c35d57e9abfb62bdee145828011b1b0.tar.xz forums-1c5b1ede1c35d57e9abfb62bdee145828011b1b0.zip | |
[ticket/10271] Added comments to AJAX callbacks.
PHPBB3-10271
Diffstat (limited to 'phpBB/styles/prosilver')
| -rw-r--r-- | phpBB/styles/prosilver/template/ajax.js | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index 58b765779e..66b34f7726 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -1,7 +1,7 @@ (function($) { // Avoid conflicts with other libraries - +//This callback finds the post from the delete link, and removes it. phpbb.add_ajax_callback('post_delete', function(el) { if ($(this).data('refresh') === undefined) { @@ -10,18 +10,30 @@ phpbb.add_ajax_callback('post_delete', function(el) { $(this).remove(); }); } -}).add_ajax_callback('post_approve', function(el, res, act) { +}); + +// This callback removes the approve / disapprove div or link. +phpbb.add_ajax_callback('post_approve', function(el, res, act) { $(el).parents((act === 'approve') ? '.rules' : '.post').fadeOut(function() { $(this).remove(); }); -}).add_ajax_callback('qr-submit', function(el) { +}); + +// This callback handles the removal of the quick reply form. +phpbb.add_ajax_callback('qr-submit', function(el) { $(el).parents('form').fadeOut(function() { $(this).remove(); }); -}).add_ajax_callback('row_delete', function(el) { +}); + +// This removes the parent row of the link or form that fired the callback. +phpbb.add_ajax_callback('row_delete', function(el) { var tr = $(el).parents('tr'); tr.remove(); -}).add_ajax_callback('zebra', function(el, res) { +}); + +// This handles friend / foe additions removals. +phpbb.add_ajax_callback('zebra', function(el, res) { if (res.success) { $('.zebra').html(res.MESSAGE_TEXT); $($('.zebra').get(1)).remove(); @@ -37,6 +49,11 @@ $('[data-ajax]').each(function() { +/** + * This AJAXifies the quick-mod tools. The reason it cannot be a standard + * callback / data attribute is that it requires exceptions - some of the options + * can be ajaxified, while others cannot. + */ phpbb.ajaxify({ selector: '#quickmodform', exception: function(el, act, data) { |
