aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/adm/style/ajax.js
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2013-12-30 11:23:22 -0800
committerNathan Guse <nathaniel.guse@gmail.com>2013-12-30 11:23:22 -0800
commitb186d31ce6b0502898e93cfa5e69e2d0da0758d0 (patch)
tree29560154f28c0e4df80ad93df4397c2178a72fc7 /phpBB/adm/style/ajax.js
parentbe67124dc7d5461c9b085e4dc3f32ece87e4b1aa (diff)
parent06262aca541691fd28f02d9b6983b57429f4a671 (diff)
downloadforums-b186d31ce6b0502898e93cfa5e69e2d0da0758d0.tar
forums-b186d31ce6b0502898e93cfa5e69e2d0da0758d0.tar.gz
forums-b186d31ce6b0502898e93cfa5e69e2d0da0758d0.tar.bz2
forums-b186d31ce6b0502898e93cfa5e69e2d0da0758d0.tar.xz
forums-b186d31ce6b0502898e93cfa5e69e2d0da0758d0.zip
Merge pull request #1920 from prototech/ticket/12038
[ticket/12038] AJAXify move up/down buttons for various ACP pages.
Diffstat (limited to 'phpBB/adm/style/ajax.js')
-rw-r--r--phpBB/adm/style/ajax.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js
index 78fcbd88fd..959580d6c2 100644
--- a/phpBB/adm/style/ajax.js
+++ b/phpBB/adm/style/ajax.js
@@ -8,7 +8,11 @@
* an item is moved up. It moves the row up or down, and deactivates /
* activates any up / down icons that require it (the ones at the top or bottom).
*/
-phpbb.addAjaxCallback('row_down', function() {
+phpbb.addAjaxCallback('row_down', function(res) {
+ if (typeof res.success === 'undefined' || !res.success) {
+ return;
+ }
+
var el = $(this),
tr = el.parents('tr'),
trSwap = tr.next();
@@ -16,7 +20,11 @@ phpbb.addAjaxCallback('row_down', function() {
tr.insertAfter(trSwap);
});
-phpbb.addAjaxCallback('row_up', function() {
+phpbb.addAjaxCallback('row_up', function(res) {
+ if (typeof res.success === 'undefined' || !res.success) {
+ return;
+ }
+
var el = $(this),
tr = el.parents('tr'),
trSwap = tr.prev();