mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
+ Added ability (disabled) to autosave "Show notes" toggle status
This commit is contained in:
parent
9a947d9f08
commit
614c93cb19
3 changed files with 18 additions and 1 deletions
10
src/ajax.php
10
src/ajax.php
|
|
@ -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;
|
||||
}
|
||||
|
||||
###################################################################################################
|
||||
|
||||
|
|
|
|||
|
|
@ -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){});
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue