Skip to content
Snippets Groups Projects
Commit ec905888 authored by jurgenhaas's avatar jurgenhaas
Browse files

github#1 Fix the broken stop timer function

parent 29364201
No related branches found
No related tags found
1 merge request!3Version 1.8
......@@ -140,10 +140,8 @@ function TogglButtonGM(selector, renderer) {
if (result.status === 200) {
var resp = JSON.parse(result.responseText),
data = resp.data || false;
if (data) {
for (i in $instances) {
$instances[i].checkCurrentLinkStatus(data);
}
for (i in $instances) {
$instances[i].checkCurrentLinkStatus(data);
}
}
}
......@@ -450,12 +448,13 @@ function TogglButtonGM(selector, renderer) {
"Authorization": "Basic " + btoa($api_token + ':api_token')
},
onload: function (result) {
$curEntryId = null;
document.dispatchEvent(new CustomEvent('TogglButtonGMUpdateStatus'));
if (result.status === 200) {
var resp = JSON.parse(result.responseText),
data = resp.data || false;
if (data) {
if ($stopCallback !== undefined) {
if ($stopCallback !== undefined && $stopCallback !== null) {
var currentdate = new Date();
$stopCallback((currentdate.getTime() - (data.duration * 1000)), data.duration);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment