mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-09-01 10:54:00 +00:00
create alt button to open pdf in new tab
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<img :src="src" class="w-100" v-if="type !== 'pdf'">
|
||||
<div class="btn btn-complete pointer m-b-20" @click="openBase64NewTab(src)" v-show="type === 'pdf'">Open in new window</div>
|
||||
<div class="btn btn-complete pointer m-b-20" @click="openBase64NewTab()" v-show="type === 'pdf'">Open in new window</div>
|
||||
<iframe v-if="type === 'pdf'" class="pdf-display w-100 scrollable" style="height: 80vh" :src="'data:application/pdf;base64,'+src"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
@@ -49,8 +49,8 @@
|
||||
renderPdf() {
|
||||
this.isLoading = false;
|
||||
},
|
||||
openBase64NewTab(base64Pdf) {
|
||||
var blob = this.base64toBlob(base64Pdf);
|
||||
openBase64NewTab() {
|
||||
var blob = this.base64toBlob(this.src);
|
||||
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
|
||||
window.navigator.msSaveOrOpenBlob(blob, "pdfBase64.pdf");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user