aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/styles/prosilver
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2012-02-08 19:02:16 +0100
committerIgor Wiedler <igor@wiedler.ch>2012-03-31 02:09:24 +0200
commit628074bf7057ad5f9aff929d7c8cd85171ce60b8 (patch)
treee597dc84afc1a5ce6ac412b7a981f4f9df5dd0d6 /phpBB/styles/prosilver
parentb100bb9a69982221e7244ac74dd1de421b6344bc (diff)
downloadforums-628074bf7057ad5f9aff929d7c8cd85171ce60b8.tar
forums-628074bf7057ad5f9aff929d7c8cd85171ce60b8.tar.gz
forums-628074bf7057ad5f9aff929d7c8cd85171ce60b8.tar.bz2
forums-628074bf7057ad5f9aff929d7c8cd85171ce60b8.tar.xz
forums-628074bf7057ad5f9aff929d7c8cd85171ce60b8.zip
[feature/ajax] Stylistic JavaScript adjustments
PHPBB3-10270
Diffstat (limited to 'phpBB/styles/prosilver')
-rw-r--r--phpBB/styles/prosilver/template/ajax.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js
index a0f0c820ba..bf7551b8b8 100644
--- a/phpBB/styles/prosilver/template/ajax.js
+++ b/phpBB/styles/prosilver/template/ajax.js
@@ -3,10 +3,12 @@
// This callback finds the post from the delete link, and removes it.
phpbb.add_ajax_callback('post_delete', function() {
- var el = $(this);
+ var el = $(this),
+ post_id;
+
if (el.attr('data-refresh') === undefined)
{
- var post_id = el[0].href.split('&p=')[1];
+ post_id = el[0].href.split('&p=')[1];
el.parents('#p' + post_id).fadeOut(function() {
$(this).remove();
});
@@ -34,20 +36,25 @@ phpbb.add_ajax_callback('row_delete', function() {
// This handles friend / foe additions removals.
phpbb.add_ajax_callback('zebra', function(res) {
+ var zebra;
+
if (res.success) {
- var zebra = $('.zebra');
+ zebra = $('.zebra');
zebra.html(res.MESSAGE_TEXT);
$(zebra.get(1)).remove();
}
-});;
+});
$('[data-ajax]').each(function() {
- var $this = $(this), ajax = $this.attr('data-ajax');
+ var $this = $(this),
+ ajax = $this.attr('data-ajax'),
+ fn;
+
if (ajax !== 'false')
{
- var fn = (ajax !== 'true') ? ajax : null;
+ fn = (ajax !== 'true') ? ajax : null;
phpbb.ajaxify({selector: this}, $this.attr('data-refresh') !== undefined, fn);
}
});