This commit is contained in:
bel
2021-08-05 23:45:11 -06:00
parent 2763b68bc4
commit fc088ec240
4 changed files with 32 additions and 10 deletions

View File

@@ -50,7 +50,7 @@ function getGetParamValue(url, paramName) {
this._lists = {};
this._length = 0;
this._order = [];
this._alltasks = {id: -1, showCompl: 0, sort: 3};
this._alltasks = {id: -1, showCompl: 0, showLooping: 0, sort: 3};
},
length: function () {
return this._length;
@@ -851,6 +851,7 @@ function getGetParamValue(url, paramName) {
_mtt.db.request('loadTasks', {
list: curList.id,
compl: curList.showCompl,
looping: curList.showLooping,
sort: curList.sort,
search: filter.search,
tag: _mtt.filter.getTags(true),
@@ -1233,6 +1234,9 @@ function getGetParamValue(url, paramName) {
case 'btnRssFeed':
feedCurList();
break;
case 'btnShowLooping':
showLoopingToggle();
break;
case 'btnShowCompleted':
showCompletedToggle();
break;
@@ -1892,6 +1896,8 @@ function getGetParamValue(url, paramName) {
}
if (list.showCompl) $('#btnShowCompleted').addClass('mtt-item-checked');
else $('#btnShowCompleted').removeClass('mtt-item-checked');
if (list.showLooping) $('#btnShowLooping').addClass('mtt-item-checked');
else $('#btnShowLooping').removeClass('mtt-item-checked');
}
function listOrderChanged(event, ui) {
@@ -1905,6 +1911,14 @@ function getGetParamValue(url, paramName) {
_mtt.doAction('listOrderChanged', {order: order});
}
function showLoopingToggle() { // todo
var act = curList.showLooping ? 0 : 1;
curList.showLooping = tabLists.get(curList.id).showLooping = act;
if (act) $('#btnShowLooping').addClass('mtt-item-checked');
else $('#btnShowLooping').removeClass('mtt-item-checked');
loadTasks({setLooping: 1});
}
function showCompletedToggle() {
var act = curList.showCompl ? 0 : 1;
curList.showCompl = tabLists.get(curList.id).showCompl = act;