]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/blobdiff - frontend/js/app.js
Make configuration not editable
[perso/Immae/Projets/Nodejs/Surfer.git] / frontend / js / app.js
index 9ce073e39383afa76c0a2ad189bfeabdce131e33..61f1b46979221ea1bc77fad32444c71b042566bc 100644 (file)
@@ -150,7 +150,15 @@ function open(row, column, event) {
     app.activeEntry.fullPath = encode(sanitize(app.path + '/' + row.filePath));
     app.previewDrawerVisible = true
 
-    // window.open(encode(path));
+    // need to wait for DOM element to exist
+    setTimeout(function () {
+        $('iframe').on('load', function (e) {
+            if (!e.target.contentWindow.document.body) return;
+
+            e.target.contentWindow.document.body.style.display = 'flex'
+            e.target.contentWindow.document.body.style.justifyContent = 'center'
+        });
+    }, 0);
 }
 
 function uploadFiles(files) {
@@ -492,7 +500,8 @@ var app = new Vue({
         },
         open: open,
         drop: drop,
-        dragOver: dragOver
+        dragOver: dragOver,
+        sanitize: sanitize
     }
 });