diff --git a/report/insights/amd/build/actions.min.js b/report/insights/amd/build/actions.min.js index 431a58b2287..71cc939b182 100644 --- a/report/insights/amd/build/actions.min.js +++ b/report/insights/amd/build/actions.min.js @@ -1 +1 @@ -define(["jquery","core/ajax","core/notification"],function(a,b,c){return{init:function(d){a("a[data-prediction-methodname][data-prediction-id="+d+"]").on("click",function(e){e.preventDefault();var f=a(e.currentTarget),g=f.attr("data-prediction-methodname"),h=f.closest("tr");if(h.length>0){var i=b.call([{methodname:g,args:{predictionid:d}}])[0];i.done(function(){h[0].remove(),a(".insights-list tr").length<2&&window.history.back()}).fail(c.exception)}})}}}); \ No newline at end of file +define(["jquery","core/ajax","core/notification"],function(a,b,c){return{init:function(d){a("a[data-prediction-methodname][data-prediction-id="+d+"]").on("click",function(e){e.preventDefault();var f=a(e.currentTarget),g=f.attr("data-prediction-methodname"),h=f.closest("tr");if(h.length>0){var i=b.call([{methodname:g,args:{predictionid:d}}])[0];i.done(function(){h[0].remove(),a(".insights-list tr").length<2&&(document.referrer?window.location.assign(document.referrer):window.location.reload(!0))}).fail(c.exception)}})}}}); \ No newline at end of file diff --git a/report/insights/amd/src/actions.js b/report/insights/amd/src/actions.js index bc10ce2a415..3c98868fc90 100644 --- a/report/insights/amd/src/actions.js +++ b/report/insights/amd/src/actions.js @@ -57,7 +57,11 @@ define(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notificat // Move back if no remaining predictions. if ($('.insights-list tr').length < 2) { - window.history.back(); + if (document.referrer) { + window.location.assign(document.referrer); + } else { + window.location.reload(true); + } } }).fail(Notification.exception); }