Fix test, misc

This commit is contained in:
Peter Jaszkowiak
2017-02-23 17:29:08 -07:00
parent 3e562ceb83
commit ee9d7584e4
3 changed files with 6 additions and 4 deletions

View File

@@ -125,10 +125,10 @@ define('admin/manage/categories', ['vendor/jquery/serializeObject/jquery.ba-seri
}
function itemDragDidEnd(e) {
var isCategoryUpdate = (newCategoryId !== -1);
var isCategoryUpdate = parseInt(newCategoryId, 10) !== -1;
// Update needed?
if ((e.newIndex != null && e.oldIndex !== e.newIndex) || isCategoryUpdate) {
if ((e.newIndex != null && parseInt(e.oldIndex, 10) !== parseInt(e.newIndex, 10)) || isCategoryUpdate) {
var parentCategory = isCategoryUpdate ? sortables[newCategoryId] : sortables[e.from.dataset.cid];
var modified = {};
var i = 0;