Skip to content

Commit

Permalink
fix-sync: add missing changes to 3120880
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksey-hoffman committed Jun 21, 2021
1 parent 395685d commit 7ee1747
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions public/quickViewWindow.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@
return safePath
}

function getSafeURL (path) {
const safeFileProtocol = process.env.NODE_ENV === 'development'
? 'file'
: 'sigma-file-manager'
return `${safeFileProtocol}://${getUrlSafePath(path)}`
}

function adjastWindowToContentSize (w, h) {
if (w && h && w > 0 && h > 0) {
try {
Expand Down Expand Up @@ -120,7 +113,7 @@
// Load the file and adjust window size
if (isVideo) {
const videoNode = document.createElement('video')
videoNode.setAttribute('src', getSafeURL(data.path))
videoNode.setAttribute('src', getUrlSafePath(data.path))
videoNode.setAttribute('controls', true)
videoNode.setAttribute('autoplay', true)
contentContainerNode.appendChild(videoNode)
Expand All @@ -132,7 +125,7 @@
}
else if (isImage) {
const imageNode = document.createElement('img')
imageNode.setAttribute('src', getSafeURL(data.path))
imageNode.setAttribute('src', getUrlSafePath(data.path))
contentContainerNode.appendChild(imageNode)
imageNode.addEventListener('load', event => {
let w = imageNode.naturalWidth
Expand All @@ -144,7 +137,7 @@
const webviewNode = document.createElement('webview')
webviewNode.setAttribute('id', 'content-webview')
webviewNode.setAttribute('partition', 'quickView')
webviewNode.setAttribute('src', getSafeURL(data.path))
webviewNode.setAttribute('src', getUrlSafePath(data.path))
contentContainerNode.appendChild(webviewNode)
}
// Wait before showing the window in case the file is not supported
Expand Down

0 comments on commit 7ee1747

Please sign in to comment.