X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=frontend%2Fjs%2Fapp.js;h=f532bc1e508515a9196329474af9e53450644ce9;hb=83544c5c8685db63b98d8035b99c501afe509776;hp=05cbe9ca331fb878b1974274e35a9b89b354367c;hpb=c2c00fca7dccb6e512a0f01bc87db129538765ef;p=perso%2FImmae%2FProjets%2FNodejs%2FSurfer.git diff --git a/frontend/js/app.js b/frontend/js/app.js index 05cbe9c..f532bc1 100644 --- a/frontend/js/app.js +++ b/frontend/js/app.js @@ -135,7 +135,7 @@ function loadDirectory(filePath) { }); } -function open(row, event, column) { +function open(row, column, event) { // ignore item open on row clicks if we are renaming this entry if (row.rename) return; @@ -146,7 +146,19 @@ function open(row, event, column) { 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