diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2013-12-30 11:23:22 -0800 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2013-12-30 11:23:22 -0800 |
commit | b186d31ce6b0502898e93cfa5e69e2d0da0758d0 (patch) | |
tree | 29560154f28c0e4df80ad93df4397c2178a72fc7 /phpBB/adm/style/ajax.js | |
parent | be67124dc7d5461c9b085e4dc3f32ece87e4b1aa (diff) | |
parent | 06262aca541691fd28f02d9b6983b57429f4a671 (diff) | |
download | forums-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.js | 12 |
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(); |