Removed redundant HTML response type check for preview code

This commit is contained in:
Andrew Bastin
2020-06-22 03:36:34 -04:00
parent d81306ac1a
commit d31da4a0ec

View File

@@ -151,10 +151,6 @@ export default {
togglePreview() { togglePreview() {
this.previewEnabled = !this.previewEnabled this.previewEnabled = !this.previewEnabled
if (this.previewEnabled) { if (this.previewEnabled) {
// If you want to add 'preview' support for other response types,
// just add them here.
if (this.responseType === "text/html") {
// If the preview already has that URL loaded, let's not bother re-loading it all.
if (this.$refs.previewFrame.getAttribute("data-previewing-url") === this.url) return if (this.$refs.previewFrame.getAttribute("data-previewing-url") === this.url) return
// Use DOMParser to parse document HTML. // Use DOMParser to parse document HTML.
const previewDocument = new DOMParser().parseFromString( const previewDocument = new DOMParser().parseFromString(
@@ -168,7 +164,6 @@ export default {
this.$refs.previewFrame.srcdoc = previewDocument.documentElement.outerHTML this.$refs.previewFrame.srcdoc = previewDocument.documentElement.outerHTML
this.$refs.previewFrame.setAttribute("data-previewing-url", this.url) this.$refs.previewFrame.setAttribute("data-previewing-url", this.url)
} }
}
}, },
}, },
} }