diff --git a/src/includes/mytinytodo.js b/src/includes/mytinytodo.js
index 598e89b..ec7bd6f 100644
--- a/src/includes/mytinytodo.js
+++ b/src/includes/mytinytodo.js
@@ -713,18 +713,14 @@ var mytinytodo = window.mytinytodo = _mtt = {
// open all tasks tab
if(_mtt.options.openList == -1) openListId = -1;
- $.each(res.list, function(i,item) {
- if ( item.id == -1) {
+ $.each(res.list, function(i, item) {
+ if ( item.id == -1 ) {
tabLists._alltasks = item;
- ti += '
'+
- ''+item.name+''+
- '
';
+ ti += prepareListHtml(item);
}
else {
tabLists.add(item);
- ti += ''+
- ''+item.name+''+
- '
';
+ ti += prepareListHtml(item);
}
});
}
@@ -954,13 +950,13 @@ function addList()
var item = json.list[0];
var i = tabLists.length();
tabLists.add(item);
- if(i > 0) {
- $('#lists ul').append(''+
- ''+item.name+''+
- '');
+ if (i > 0) {
+ $('#lists ul').append(prepareListHtml(item));
mytinytodo.doAction('listAdded', item);
}
- else _mtt.loadLists();
+ else {
+ _mtt.loadLists();
+ }
});
});
};
@@ -1047,6 +1043,19 @@ function loadTasks(opts)
});
};
+function prepareListHtml(list)
+{
+ var opentag = '';
+ if (list.id == -1) {
+ opentag = '';
+ }
+ else {
+ opentag = '';
+ }
+ return opentag +
+ '' + list.name + '' +
+ '
';
+}
function prepareTaskStr(item, noteExp)
{