* code for task#1657.

This commit is contained in:
xia0ta0
2013-07-31 10:28:37 +08:00
parent 00586a2b39
commit 44376ef1d1
3 changed files with 38 additions and 2 deletions

View File

@@ -20,4 +20,37 @@ function changeAction(formName, actionName, actionLink)
$('#' + formName).attr('action', actionLink).submit();
}
/**
* Delete todo.
*
* @param int todoID
* @access public
* @return void
*/
function deleteTodo(todoID)
{
if(confirm(confirmDelete))
{
url = createLink('todo', 'delete','todoID=' + todoID + '&confrim=yes');
$.ajax(
{
type: 'GET',
url: url,
dataType: 'json',
success: function(data)
{
if(data.result == 'success')
{
url = createLink('my', 'todo');
$('#todo').load(url + ' #todoList', function()
{
$('.colored').colorize();
$('tfoot td').css('background', 'white').unbind('click').unbind('hover');
});
}
}
});
}
}
$(".colorbox").colorbox({width:960, height:550, iframe:true, transition:'none'});

View File

@@ -14,6 +14,7 @@
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/colorize.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<?php js::set('confirmDelete', $lang->todo->confirmDelete)?>
<form method='post' id='todoform'>
<div id='featurebar'>
<div class='f-left'>
@@ -48,7 +49,9 @@
?>
</div>
</div>
<?php include "./todolist.html.php"?>
<div id='todo'>
<?php include "./todolist.html.php"?>
</div>
</form>
<?php js::set('listName', 'todoList')?>
<?php include '../../common/view/footer.html.php';?>

View File

@@ -33,7 +33,7 @@
<?php
common::printIcon('todo', 'finish', "id=$todo->id", $todo, 'list', '', 'hiddenwin');
common::printIcon('todo', 'edit', "id=$todo->id", '', 'list', '', '', 'iframe', true);
common::printIcon('todo', 'delete', "id=$todo->id", '', 'list', '', 'hiddenwin');
echo html::a("javascript:deleteTodo($todo->id)", '&nbsp;', '', "class='icon-green-common-delete' title='{$lang->todo->delete}'");
?>
</td>
</tr>