document repositioning after delation
This commit is contained in:
@@ -50,4 +50,14 @@ class CategoryDocument extends BaseCategoryDocument
|
|||||||
{
|
{
|
||||||
return $this->getCategoryId();
|
return $this->getCategoryId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function preDelete(ConnectionInterface $con = null)
|
||||||
|
{
|
||||||
|
$this->reorderBeforeDelete(
|
||||||
|
array(
|
||||||
|
"category_id" => $this->getCategoryId(),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -50,4 +50,14 @@ class ContentDocument extends BaseContentDocument
|
|||||||
{
|
{
|
||||||
return $this->getContentId();
|
return $this->getContentId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function preDelete(ConnectionInterface $con = null)
|
||||||
|
{
|
||||||
|
$this->reorderBeforeDelete(
|
||||||
|
array(
|
||||||
|
"content_id" => $this->getContentId(),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,4 +50,14 @@ class FolderDocument extends BaseFolderDocument
|
|||||||
{
|
{
|
||||||
return $this->getFolderId();
|
return $this->getFolderId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function preDelete(ConnectionInterface $con = null)
|
||||||
|
{
|
||||||
|
$this->reorderBeforeDelete(
|
||||||
|
array(
|
||||||
|
"folder_id" => $this->getFolderId(),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,4 +51,14 @@ class ProductDocument extends BaseProductDocument
|
|||||||
return $this->getProductId();
|
return $this->getProductId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function preDelete(ConnectionInterface $con = null)
|
||||||
|
{
|
||||||
|
$this->reorderBeforeDelete(
|
||||||
|
array(
|
||||||
|
"product_id" => $this->getProductId(),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ $(function($){
|
|||||||
documentDropzone.removeFile(file);
|
documentDropzone.removeFile(file);
|
||||||
$.documentUploadManager.updateDocumentListAjax();
|
$.documentUploadManager.updateDocumentListAjax();
|
||||||
$.documentUploadManager.onClickDeleteDocument();
|
$.documentUploadManager.onClickDeleteDocument();
|
||||||
$.documentUploadManager.sortDocument();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -66,6 +65,7 @@ $(function($){
|
|||||||
data
|
data
|
||||||
);
|
);
|
||||||
$.documentUploadManager.onClickDeleteDocument();
|
$.documentUploadManager.onClickDeleteDocument();
|
||||||
|
$.documentUploadManager.sortDocument();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -90,11 +90,16 @@ $(function($){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).done(function(data) {
|
}).done(function(data) {
|
||||||
$parent.parents('tr').remove();
|
$parent.parents('li').remove();
|
||||||
|
|
||||||
$(".document-manager .message").html(
|
$(".document-manager .message").html(
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/* refresh position */
|
||||||
|
$( "#js-sort-document").children('li').each(function(position, element) {
|
||||||
|
$(element).find('.js-sorted-position').html(position + 1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user