mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-14 20:29:07 +00:00
Rename SvgViewer.init to render and update usage
This commit is contained in:
@@ -5,15 +5,15 @@
|
||||
<title>LottieFiles Preview</title>
|
||||
<style>
|
||||
html, body {
|
||||
width: 100%;
|
||||
height:100%;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
height:100%;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#bm {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
@@ -242,10 +242,10 @@ class SvgViewer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize SVG viewer.
|
||||
* Render SVG file.
|
||||
* @async
|
||||
*/
|
||||
async init() {
|
||||
async render() {
|
||||
const rawSvg = await chrome.webview.hostObjects.external.GetSvgContent();
|
||||
const parser = new DOMParser();
|
||||
const doc = parser.parseFromString(rawSvg, 'image/svg+xml');
|
||||
@@ -263,5 +263,5 @@ class SvgViewer {
|
||||
}
|
||||
}
|
||||
|
||||
// Create and initialize the SVG viewer
|
||||
new SvgViewer().init();
|
||||
// Create the SVG viewer and render
|
||||
new SvgViewer().render();
|
Reference in New Issue
Block a user