diff options
| author | Callum Macrae <callum@lynxphp.com> | 2011-08-24 15:45:51 +0100 |
|---|---|---|
| committer | Igor Wiedler <igor@wiedler.ch> | 2012-03-31 02:09:15 +0200 |
| commit | 1cb3b595ec70730429a9c8654b248fc6d50cf1b3 (patch) | |
| tree | 505b6171c128ad99b206182164406cced10b5ad6 /phpBB/styles | |
| parent | 11112314f757f4a6c65852817fba0f1a2f4526d2 (diff) | |
| download | forums-1cb3b595ec70730429a9c8654b248fc6d50cf1b3.tar forums-1cb3b595ec70730429a9c8654b248fc6d50cf1b3.tar.gz forums-1cb3b595ec70730429a9c8654b248fc6d50cf1b3.tar.bz2 forums-1cb3b595ec70730429a9c8654b248fc6d50cf1b3.tar.xz forums-1cb3b595ec70730429a9c8654b248fc6d50cf1b3.zip | |
[ticket/10271] AJAXified the styles tab in the ACP.
PHPBB3-10271
Diffstat (limited to 'phpBB/styles')
| -rw-r--r-- | phpBB/styles/script.js | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/phpBB/styles/script.js b/phpBB/styles/script.js index 85dcdb25f5..44b21906cc 100644 --- a/phpBB/styles/script.js +++ b/phpBB/styles/script.js @@ -225,10 +225,9 @@ phpbb.ajaxify = function(options, refresh, callback) { { // It is a standard link, no confirm_box required. var alert = phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT); - callback = phpbb.ajax_callbacks[callback]; - if (typeof callback === 'function') + if (typeof phpbb.ajax_callbacks[callback] === 'function') { - callback(that, (is_form) ? act : null); + phpbb.ajax_callbacks[callback](that, res, (is_form) ? act : null); } handle_refresh(res.REFRESH_DATA, refresh, alert); } @@ -243,10 +242,9 @@ phpbb.ajaxify = function(options, refresh, callback) { phpbb.loading_alert(); $.post(path, data + '&confirm=' + res.YES_VALUE, function(res) { var alert = phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT); - callback = phpbb.ajax_callbacks[callback]; - if (typeof callback === 'function') + if (typeof phpbb.ajax_callbacks[callback] === 'function') { - callback(that, res, (is_form) ? act : null); + phpbb.ajax_callbacks[callback](that, res, (is_form) ? act : null); } handle_refresh(res.REFRESH_DATA, refresh, alert); }); @@ -363,6 +361,18 @@ phpbb.add_ajax_callback('post_delete', function(el) { tr.next().find('.up').html('<a href="' + tr.data('up') + '"><img src="./images/icon_up.gif" alt="Move up" title="Move up" /></a>'); phpbb.ajaxify({selector: tr.next().find('.up').children('a')}, false, 'forum_up'); } +}).add_ajax_callback('style_act_deact', function(el, res) { + $(el).text(res.text); + var new_href = $(el).attr('href'); + if (new_href.indexOf('deactivate') !== -1) + { + new_href = new_href.replace('deactivate', 'activate') + } + else + { + new_href = new_href.replace('activate', 'deactivate') + } + $(el).attr('href', new_href); }).add_ajax_callback('row_delete', function(el) { var tr = $(el).parents('tr'); tr.remove(); |
