Browse Source

Fixed multi reload problem

Manuel Gall 6 months ago
parent
commit
bee4006d26
1 changed files with 1 additions and 25 deletions
  1. 1 25
      template/js/ui.js

+ 1 - 25
template/js/ui.js

@@ -36,33 +36,9 @@ function showDocument() {
       $('head link.custom').attr('href',ret);
     }
   });
-  /*
-  $.ajax({
-    type: "GET",
-    url: 'info.json',
-    success: function(ret) {
-      makeGrid(ret.x_amount, ret.y_amount);
-      //set name
-      document.title = ret.document_name;
-      $.ajax({
-        type: "GET",
-        url: 'frames.json',
-        success: function(ret2) {
-          for (i of ret2.data) {
-            makeFrame(i.lx,i.ly,i.rx,i.ry, i.url, i.callback, i.default, i.showbutton, i.style);
-          } 
-        }
-      });
-    },
-    error: function() {
-      reason = '';
-      clearDocument();
-    }
-  });*/
 }
 
 function clearDocument() {
-  console.log('rrrr');
   $('#languages').addClass('hidden');
   $('#nope').removeClass('hidden');
   $('#control .added').remove();
@@ -75,7 +51,6 @@ function init() {
   es = new EventSource('sse/');
   es.onopen = function() {
     getAllData();
-    // load
   };
   es.onmessage = function(e) {
     console.log("Got SSE");
@@ -105,6 +80,7 @@ function init() {
   es.onerror = function() {
     reason = 'Server down.';
     clearDocument();
+    es.close();
     setTimeout(init, 10000);
   };
 }