From 23c9bc083d638d407f25b9d34e355b973d828847 Mon Sep 17 00:00:00 2001 From: marvin78 Date: Tue, 14 Jan 2020 12:02:54 +0000 Subject: [PATCH] 98_todoist: bugfix - better move to other project in widget git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@20973 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/98_todoist.pm | 2 +- www/pgm2/todoist.js | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/FHEM/98_todoist.pm b/FHEM/98_todoist.pm index 7742a52ea..34d8c54ac 100644 --- a/FHEM/98_todoist.pm +++ b/FHEM/98_todoist.pm @@ -787,7 +787,7 @@ 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" || $param->{wType} eq "move") { + if ($param->{wType} eq "create") { if ($param->{parentId}) { # set parent id with additional updateTask command / API cannot add it in create CommandSet(undef, "$name moveTask ID:$taskId parent_id=".$param->{parentId}); diff --git a/www/pgm2/todoist.js b/www/pgm2/todoist.js index e77b0e7d9..d6fa684d9 100644 --- a/www/pgm2/todoist.js +++ b/www/pgm2/todoist.js @@ -312,8 +312,8 @@ if (typeof todoist_checkVar === 'undefined') { var parent = ui.item.parent().parent(); var id = $(parent).attr('id'); var name = id.split(/_(.+)/)[1]; - if (ui.item.attr('data-remove')==1) ui.item.remove(); - todoist_refreshTable(name,1); + //if (ui.item.attr('data-remove')==1) ui.item.remove(); + //todoist_refreshTable(name,1); todoist_refreshTableWidth(); }, remove: function (event,ui) { @@ -322,7 +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_refreshTable(nameH); //todoist_sendCommand('set ' + nameH + ' deleteTask ID:'+ id); }, over: function (event,ui) { @@ -338,7 +338,7 @@ if (typeof todoist_checkVar === 'undefined') { var name = id.split(/_(.+)/)[1]; $(parent).css('width',''); refreshInput(name); - todoist_refreshTable(name); + //todoist_refreshTable(name); todoist_refreshTableWidth(); }, receive: function (event,ui) { @@ -350,7 +350,9 @@ 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); + setTimeout(function(){ + todoist_refreshTable(nameR,1); + },100); ui.item.attr('data-remove','1'); } }).disableSelection();