不允许删除收藏分类

This commit is contained in:
luchenqun 2017-03-05 18:31:27 +08:00
parent 59a21b7e02
commit 322a8733b6
2 changed files with 5 additions and 3 deletions

View File

@ -181,8 +181,8 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', '$stateParams', '$tim
}
$scope.editTag = function(tag) {
if (tag.name == "未分类") {
toastr.warning('这个是系统默认分类,暂时不允许更新', "警告");
if (tag.name == "未分类" || tag.name == "收藏") {
toastr.warning('这个是系统默认分类,暂时不允许更新名字', "警告");
return;
}
tag.oldName = tag.name;
@ -227,7 +227,7 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', '$stateParams', '$tim
$scope.confirmDelTag = function(tagId, tagName) {
ngDialog.close(dialog);
var params = {
del: tagName == '未分类' ? false : true,
del: (tagName == '未分类' || tag.name == "收藏") ? false : true,
id: tagId,
}
bookmarkService.delTag(params)

View File

@ -6,6 +6,8 @@
<p>如果删除该分类,那么该分类下的所有书签都会删掉哦!数据无价,谨慎操作!且删且珍惜!</p>
<p ng-show="waitDelTag.name == '未分类'">
<code>未分类</code>为系统默认分类,只允许删除该分类下面的书签,不允许删除该分类信息</p>
<p ng-show="waitDelTag.name == '收藏'">
<code>收藏</code>为系统默认分类,只允许删除该分类下面的书签,不允许删除该分类信息</p>
</div>
<div class="ngdialog-buttons">
<button type="button" class="ngdialog-button ngdialog-button-primary" ng-click="confirmDelTag(waitDelTag.id, waitDelTag.name)">确定删除</button>