[ticket/12038] Check that the move action succeeded before moving the rows.

PHPBB3-12038
This commit is contained in:
Cesar G 2013-12-05 22:31:27 -08:00
parent 7f08a33b9f
commit 7b86a5bc60

View file

@ -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();