]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/blobdiff - frontend/js/app.js
Carry over public.html fixes to index.html
[perso/Immae/Projets/Nodejs/Surfer.git] / frontend / js / app.js
index d99a91e05f0b20bcb73ca1db072dc09f74614a93..f532bc1e508515a9196329474af9e53450644ce9 100644 (file)
@@ -146,7 +146,19 @@ function open(row, column, event) {
         return;
     }
 
-    window.open(encode(path));
+    app.activeEntry = row;
+    app.activeEntry.fullPath = encode(sanitize(app.path + '/' + row.filePath));
+    app.previewDrawerVisible = true
+
+    // 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) {
@@ -280,6 +292,8 @@ var app = new Vue({
             password: '',
             busy: false
         },
+        previewDrawerVisible: false,
+        activeEntry: {},
         entries: [],
         accessTokens: [],
         accessTokensDialogVisible: false