2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +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
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});

View File

@ -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();