2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

98_todoist: bugfix - better move to other project in widget

git-svn-id: https://svn.fhem.de/fhem/trunk@20973 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
marvin78 2020-01-14 12:02:54 +00:00
parent b1b062e62c
commit 28ba7ca6ea
2 changed files with 8 additions and 6 deletions

View File

@ -787,7 +787,7 @@ sub todoist_HandleTaskCallback($$$){
# remove line in possible webling widget # remove line in possible webling widget
map {FW_directNotify("#FHEMWEB:$_", "if (typeof todoist_removeLine === \"function\") todoist_removeLine('$name','$taskId')", "")} devspec2array("TYPE=FHEMWEB"); 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}) { if ($param->{parentId}) {
# set parent id with additional updateTask command / API cannot add it in create # set parent id with additional updateTask command / API cannot add it in create
CommandSet(undef, "$name moveTask ID:$taskId parent_id=".$param->{parentId}); CommandSet(undef, "$name moveTask ID:$taskId parent_id=".$param->{parentId});

View File

@ -312,8 +312,8 @@ if (typeof todoist_checkVar === 'undefined') {
var parent = ui.item.parent().parent(); var parent = ui.item.parent().parent();
var id = $(parent).attr('id'); var id = $(parent).attr('id');
var name = id.split(/_(.+)/)[1]; var name = id.split(/_(.+)/)[1];
if (ui.item.attr('data-remove')==1) ui.item.remove(); //if (ui.item.attr('data-remove')==1) ui.item.remove();
todoist_refreshTable(name,1); //todoist_refreshTable(name,1);
todoist_refreshTableWidth(); todoist_refreshTableWidth();
}, },
remove: function (event,ui) { remove: function (event,ui) {
@ -322,7 +322,7 @@ if (typeof todoist_checkVar === 'undefined') {
var nameHT = tid.split("_"); var nameHT = tid.split("_");
var lastVal = nameHT.pop(); // Get last element var lastVal = nameHT.pop(); // Get last element
var nameH = nameHT.join("_"); var nameH = nameHT.join("_");
todoist_refreshTable(nameH); //todoist_refreshTable(nameH);
//todoist_sendCommand('set ' + nameH + ' deleteTask ID:'+ id); //todoist_sendCommand('set ' + nameH + ' deleteTask ID:'+ id);
}, },
over: function (event,ui) { over: function (event,ui) {
@ -338,7 +338,7 @@ if (typeof todoist_checkVar === 'undefined') {
var name = id.split(/_(.+)/)[1]; var name = id.split(/_(.+)/)[1];
$(parent).css('width',''); $(parent).css('width','');
refreshInput(name); refreshInput(name);
todoist_refreshTable(name); //todoist_refreshTable(name);
todoist_refreshTableWidth(); todoist_refreshTableWidth();
}, },
receive: function (event,ui) { receive: function (event,ui) {
@ -350,7 +350,9 @@ if (typeof todoist_checkVar === 'undefined') {
var pid = parent.data('project-id'); var pid = parent.data('project-id');
var value = ui.item.find('span').html(); var value = ui.item.find('span').html();
todoist_sendCommand('set '+ nameF +' moveTask ID:' + id + ' projectID=' + pid); todoist_sendCommand('set '+ nameF +' moveTask ID:' + id + ' projectID=' + pid);
setTimeout(function(){
todoist_refreshTable(nameR,1); todoist_refreshTable(nameR,1);
},100);
ui.item.attr('data-remove','1'); ui.item.attr('data-remove','1');
} }
}).disableSelection(); }).disableSelection();