+ Added ability (disabled) to autosave "Show notes" toggle status

This commit is contained in:
Max Pozdeev 2010-10-04 23:14:28 +04:00
parent 9a947d9f08
commit 614c93cb19
3 changed files with 18 additions and 1 deletions

View file

@ -517,6 +517,16 @@ elseif(isset($_GET['clearCompletedInList']))
echo json_encode($t);
exit;
}
elseif(isset($_GET['setShowNotesInList']))
{
check_write_access();
$listId = (int)_post('list');
$flag = (int)_post('shownotes');
$bitwise = ($flag == 0) ? 'taskview & ~2' : 'taskview | 2';
$db->dq("UPDATE {$db->prefix}lists SET taskview=$bitwise WHERE id=$listId");
echo json_encode(array('total'=>1));
exit;
}
###################################################################################################

View file

@ -47,7 +47,8 @@ var mytinytodo = window.mytinytodo = _mtt = {
openList: 0,
singletab: false,
autotag: false,
tagPreview: true
tagPreview: true,
saveShowNotes: false
},
timers: {
@ -985,6 +986,7 @@ function toggleAllNotes(show)
else $('#taskrow_'+id).removeClass('task-expanded');
}
curList.showNotes = show;
if(_mtt.options.saveShowNotes) _mtt.db.request('setShowNotesInList', {list:curList.id, shownotes:show}, function(json){});
};

View file

@ -152,6 +152,11 @@ mytinytodoStorageAjax.prototype =
{
$.post(this.mtt.mttUrl+'ajax.php?publishList', { list:params.list, publish:params.publish }, callback, 'json');
},
setShowNotesInList: function(params, callback)
{
$.post(this.mtt.mttUrl+'ajax.php?setShowNotesInList', { list:params.list, shownotes:params.shownotes }, callback, 'json');
},
changeListOrder: function(params, callback)
{