tags autocomplete moved to db storage

This commit is contained in:
Max Pozdeev 2020-08-22 18:59:10 +03:00
parent 82d6d660bb
commit 07271cf645
2 changed files with 8 additions and 5 deletions

View file

@ -332,11 +332,9 @@ var mytinytodo = window.mytinytodo = _mtt = {
source: function(request, response) {
var taskId = document.getElementById('taskedit_form').id.value;
var listId = taskList[taskId].listId;
jQuery.get("ajax.php?suggestTags&list="+listId, {
q: ac_extractLast(request.term)
}, function(data) {
response(data);
});
_mtt.db.request('suggestTags', {list:listId, q:ac_extractLast(request.term)}, function(json){
response(json);
})
},/*
search: function() {
// custom minLength

View file

@ -114,6 +114,11 @@ mytinytodoStorageAjax.prototype =
}
$.post(this.mtt.mttUrl+'ajax.php?changeOrder', { order:order }, callback, 'json');
},
suggestTags: function(params, callback)
{
$.getJSON(this.mtt.mttUrl+'ajax.php?suggestTags', {list:params.list, q:params.q, rnd:Math.random()}, callback);
},
tagCloud: function(params, callback)
{