diff --git a/fhem/FHEM/98_todoist.pm b/fhem/FHEM/98_todoist.pm index 3e6aa2581..7742a52ea 100644 --- a/fhem/FHEM/98_todoist.pm +++ b/fhem/FHEM/98_todoist.pm @@ -787,10 +787,10 @@ sub todoist_HandleTaskCallback($$$){ # remove line in possible webling widget map {FW_directNotify("#FHEMWEB:$_", "if (typeof todoist_removeLine === \"function\") todoist_removeLine('$name','$taskId')", "")} devspec2array("TYPE=FHEMWEB"); } - if ($param->{wType} eq "create") { + if ($param->{wType} eq "create" || $param->{wType} eq "move") { if ($param->{parentId}) { # set parent id with additional updateTask command / API cannot add it in create - CommandSet(undef, "$name updateTask ID:$taskId parent_id=".$param->{parentId}); + CommandSet(undef, "$name moveTask ID:$taskId parent_id=".$param->{parentId}); Log3 $name, 3, "todoist ($name): startet set parent_id over update after create: Task-ID: ".$taskId." - parent_id: ".$param->{parentId}; } # add a line in possible weblink widget diff --git a/fhem/www/pgm2/todoist.js b/fhem/www/pgm2/todoist.js index c5aaff46d..e77b0e7d9 100644 --- a/fhem/www/pgm2/todoist.js +++ b/fhem/www/pgm2/todoist.js @@ -322,6 +322,7 @@ if (typeof todoist_checkVar === 'undefined') { var nameHT = tid.split("_"); var lastVal = nameHT.pop(); // Get last element var nameH = nameHT.join("_"); + todoist_refreshTable(nameH); //todoist_sendCommand('set ' + nameH + ' deleteTask ID:'+ id); }, over: function (event,ui) { @@ -349,6 +350,7 @@ if (typeof todoist_checkVar === 'undefined') { var pid = parent.data('project-id'); var value = ui.item.find('span').html(); todoist_sendCommand('set '+ nameF +' moveTask ID:' + id + ' projectID=' + pid); + todoist_refreshTable(nameR,1); ui.item.attr('data-remove','1'); } }).disableSelection();