Pārlūkot izejas kodu

Fixed minor path issue on file selector of Office Viewer

Toby Chui 2 gadi atpakaļ
vecāks
revīzija
3a1531d13c
2 mainītis faili ar 5 papildinājumiem un 2 dzēšanām
  1. 0 1
      web/OfficeViewer/embedded.html
  2. 5 1
      web/OfficeViewer/index.html

+ 0 - 1
web/OfficeViewer/embedded.html

@@ -1,6 +1,5 @@
 <!DOCTYPE html>
 <html>
-
 <head>
   <title>Office Viewer</title>
   <meta charset="utf-8">

+ 5 - 1
web/OfficeViewer/index.html

@@ -44,7 +44,11 @@
                 }else{
                     console.log(encodeURIComponent(JSON.stringify(filedata)));
                     ao_module_setWindowSize(1060, 680);
-                    window.location.href= window.location.href + "/embedded.html#" + encodeURIComponent(JSON.stringify(filedata));
+                    let redirectionURL = "embedded.html#" + encodeURIComponent(JSON.stringify(filedata));
+                    if (window.location.href.substr(window.location.href.length - 1) != "/"){
+                        redirectionURL = "/" + redirectionURL;
+                    }
+                    window.location.href= window.location.href + redirectionURL;
                 }
             }
 		</script>