From 9ef77a14cd3c854e9462442cad31893ad05b8308 Mon Sep 17 00:00:00 2001 From: Yoshiyuki Ieyama Date: Tue, 4 Oct 2016 01:06:46 +0900 Subject: [PATCH] escape javascript error when result does not contain static file. --- includes/class-static_press_admin.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/class-static_press_admin.php b/includes/class-static_press_admin.php index c7ec841..ec1a76d 100644 --- a/includes/class-static_press_admin.php +++ b/includes/class-static_press_admin.php @@ -308,7 +308,8 @@ function static_press_fetch(){ ul.append('
  • ' + file_count + ' : ' + this.static + '
  • '); } }); - $('html,body').animate({scrollTop: $('li:last-child', ul).offset().top},'slow'); + if(ul.children().size() > 0) + $('html,body').animate({scrollTop: $('li:last-child', ul).offset().top},'slow'); if (response.final) static_press_finalyze(); else