* finish task #2932

This commit is contained in:
pengjiangxiu
2017-02-23 13:04:35 +08:00
parent 82c7d41f08
commit 0e5c648c54
2 changed files with 18 additions and 4 deletions
+16 -2
View File
@@ -75,8 +75,22 @@ function setTemplate(templateID)
function deleteTemplate(templateID)
{
if(!templateID) return;
hiddenwin.location.href = createLink('bug', 'deleteTemplate', 'templateID=' + templateID);
$('#tplBox' + templateID).addClass('hidden');
if (confirm("您确认要删除该模板吗?")){
hiddenwin.location.href = createLink('bug', 'deleteTemplate', 'templateID=' + templateID);
$('#tplBox' + templateID).addClass('hidden');
}
}
/*visbile template x icon*/
function mouseOver(delTempID)
{
$('#delTemp'+delTempID).removeClass('hidden');
}
/*hidden template x icon*/
function mouseOut(delTempID)
{
$('#delTemp'+delTempID).addClass('hidden');
}
$(function()
+2 -2
View File
@@ -1,11 +1,11 @@
<?php
foreach($templates as $key => $template)
{
echo "<li id='tplBox$template->id'>";
echo "<li id='tplBox$template->id' onmouseover='mouseOver($template->id)' onmouseout='mouseOut($template->id)'>";
echo "<a title='{$lang->bug->applyTemplate}' class='tpl-name' id='tplTitleBox$template->id' href='javascript:setTemplate($template->id)'>";
if($template->public) echo "<span class='label label-info label-badge'>{$lang->public}</span> ";
echo $template->title . "</a>";
if(empty($template->public) or $template->account == $app->user->account)echo "<a href='###' onclick='deleteTemplate($template->id)' class='btn-delete'><i class='icon-remove'></i></a>";
if(empty($template->public) or $template->account == $app->user->account)echo "<a href='###' onclick='deleteTemplate($template->id)' id='delTemp$template->id' class='btn-delete hidden'><i class='icon-remove'></i></a>";
echo "<span id='template$template->id' class='hidden'>$template->content</span>";
echo '</li>';
}