MDL-58835 report_insights: Fix redirections
authorDavid Monllao <davidm@moodle.com>
Wed, 13 Sep 2017 07:49:14 +0000 (09:49 +0200)
committerDavid Monllao <davidm@moodle.com>
Wed, 13 Sep 2017 07:49:14 +0000 (09:49 +0200)
admin/tool/analytics/classes/output/renderer.php
report/insights/amd/build/actions.min.js
report/insights/amd/src/actions.js

index 2bbfbc9..32bdcfc 100644 (file)
@@ -130,7 +130,7 @@ class renderer extends plugin_renderer_base {
         }
 
         if (!CLI_SCRIPT) {
-            $output .= $OUTPUT->single_button(new \moodle_url('/admin/tool/analytics/index.php'), get_string('continue'));
+            $output .= $OUTPUT->single_button(new \moodle_url('/admin/tool/analytics/index.php'), get_string('continue'), 'get');
         }
 
         return $output;
@@ -200,7 +200,7 @@ class renderer extends plugin_renderer_base {
         }
 
         if (!CLI_SCRIPT) {
-            $output .= $OUTPUT->single_button(new \moodle_url('/admin/tool/analytics/index.php'), get_string('continue'));
+            $output .= $OUTPUT->single_button(new \moodle_url('/admin/tool/analytics/index.php'), get_string('continue'), 'get');
         }
 
         return $output;
index 59d5035..431a58b 100644 (file)
Binary files a/report/insights/amd/build/actions.min.js and b/report/insights/amd/build/actions.min.js differ
index 2ffe7f2..bc10ce2 100644 (file)
@@ -56,7 +56,7 @@ define(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notificat
                         predictionContainers[0].remove();
 
                         // Move back if no remaining predictions.
-                        if ($('.insights-list tr').length === 0) {
+                        if ($('.insights-list tr').length < 2) {
                             window.history.back();
                         }
                     }).fail(Notification.exception);