删除贴吧 取消也会被删除

This commit is contained in:
lizanle 2015-09-25 15:23:12 +08:00
parent f501b24cbd
commit 66ea9e3052
2 changed files with 9 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<% forum.tag_list.each do |tag|%> <% forum.tag_list.each do |tag|%>
<span class="postlabel mr10"> <span class="postlabel mr10">
<a href="javascript:void(0);" ondblclick="rename_tag($(this),<%= tag %>,<%= forum.id%>,5);" class="fontGrey2 mr5"><%= tag %></a> <a href="javascript:void(0);" ondblclick="rename_tag($(this),<%= tag %>,<%= forum.id%>,5);" style="cursor: default" class="fontGrey2 mr5"><%= tag %></a>
<%if forum.creator.id == User.current.id%> <%if forum.creator.id == User.current.id%>
<a href="javascript:void(0);" class="fontGrey2" onclick="delete_forum_tag($(this));">×</a> <a href="javascript:void(0);" class="fontGrey2" onclick="delete_forum_tag($(this));">×</a>
<% end %> <% end %>

View File

@ -122,6 +122,12 @@
} }
} }
}); });
function del_confirm(){
if(confirm('您确定要删除么?')){
$("#del_link").click();
}
}
</script> </script>
</head> </head>
<body class="<%= h body_css_classes %>"> <body class="<%= h body_css_classes %>">
@ -172,7 +178,8 @@
<span class="postEdit"> <span class="postEdit">
</span> </span>
<a href="<%= edit_forum_path(@forum) %>" class="linkGrey3">编辑贴吧</a> <a href="<%= edit_forum_path(@forum) %>" class="linkGrey3">编辑贴吧</a>
<a href="<%= forum_path(@forum)%>" data-method="delete" onclick="return confirm('您确定要删除么?');" class="fr linkGrey3">删除贴吧</a> <a href="javascript:void(0);" data-method="delete" onclick="del_confirm();" class="fr linkGrey3">删除贴吧</a>
<a href="<%= forum_path(@forum)%>" data-method="delete" id="del_link" type="hidden"></a>
<span class="postDelete"></span> <span class="postDelete"></span>
<% end %> <% end %>
</div> </div>