mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/12038] Check that the move action succeeded before moving the rows.
PHPBB3-12038
This commit is contained in:
parent
7f08a33b9f
commit
7b86a5bc60
1 changed files with 10 additions and 2 deletions
|
@ -8,7 +8,11 @@
|
||||||
* an item is moved up. It moves the row up or down, and deactivates /
|
* 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).
|
* 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),
|
var el = $(this),
|
||||||
tr = el.parents('tr'),
|
tr = el.parents('tr'),
|
||||||
trSwap = tr.next();
|
trSwap = tr.next();
|
||||||
|
@ -16,7 +20,11 @@ phpbb.addAjaxCallback('row_down', function() {
|
||||||
tr.insertAfter(trSwap);
|
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),
|
var el = $(this),
|
||||||
tr = el.parents('tr'),
|
tr = el.parents('tr'),
|
||||||
trSwap = tr.prev();
|
trSwap = tr.prev();
|
||||||
|
|
Loading…
Add table
Reference in a new issue