diff --git a/README.md b/README.md index d8ce981..2ec7109 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,9 @@ Map fields (2) Changelog ================= +###0.6.3### + - Better live import updates + ###0.6.2### - Fixed a bug where errors in import failed to render a history detail page diff --git a/templates/index.html b/templates/index.html index 65f22aa..41fc98d 100644 --- a/templates/index.html +++ b/templates/index.html @@ -13,14 +13,21 @@ {% if craft.request.getParam('task') %} {% set javascript %} - setTimeout(function() { - var taskCheck = setInterval(function() { - if((Craft.cp.runningTaskInfo && Craft.cp.runningTaskInfo.id != {{ craft.request.getParam('task') }}) || Craft.cp.runningTaskInfo === null) { - clearInterval(taskCheck); - window.location.href = 'import'; + $(function() { + setTimeout(function() { + if(!$('#taskicon').length) { + window.location.reload(); + } else { + $('#taskicon').trigger('click'); + var taskCheck = setInterval(function() { + if((Craft.cp.runningTaskInfo && Craft.cp.runningTaskInfo.id != {{ craft.request.getParam('task') }}) || Craft.cp.runningTaskInfo === null) { + clearInterval(taskCheck); + window.location.href = 'scpimport'; + } + }, 500); } }, 500); - }, 500); + }); {% endset %} {% includeJs javascript %}