aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/adm/style
diff options
context:
space:
mode:
authorCesar G <prototech91@gmail.com>2013-12-05 22:31:27 -0800
committerCesar G <prototech91@gmail.com>2013-12-05 22:31:27 -0800
commit7b86a5bc6008653b7ecd0ae091089bc524ab36f4 (patch)
tree85a129dc8f300da06da749f7b0e3eb01217a87d7 /phpBB/adm/style
parent7f08a33b9fe1863aa5b43cde2f96b86afb3fa5e8 (diff)
downloadforums-7b86a5bc6008653b7ecd0ae091089bc524ab36f4.tar
forums-7b86a5bc6008653b7ecd0ae091089bc524ab36f4.tar.gz
forums-7b86a5bc6008653b7ecd0ae091089bc524ab36f4.tar.bz2
forums-7b86a5bc6008653b7ecd0ae091089bc524ab36f4.tar.xz
forums-7b86a5bc6008653b7ecd0ae091089bc524ab36f4.zip
[ticket/12038] Check that the move action succeeded before moving the rows.
PHPBB3-12038
Diffstat (limited to 'phpBB/adm/style')
-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();