Commit 3bbc2856 authored by Kevin Yumang's avatar Kevin Yumang

SERV-2286 - pdf viewer modal element

parent e04a0af2
// Resize the modal to the right size. function initPdfViewerModalElements() {
$(window).on('touchstart click resize', function () { setPdfModalButtons();
setPdfModals();
setResizeEvent();
}
function setPdfModalButtons() {
let counter = 0;
$('.LimitlessPdfViewerModalButton').each(function() {
counter++;
let element = $(this);
element.attr('id', 'LimitlessPdfViewerModalButton' + counter);
element.attr('data-target', '#LimitlessPdfModal' + counter);
});
}
function setPdfModals() {
let counter = 0;
$('.LimitlessPdfModal').each(function() {
counter++;
let element = $(this);
element.attr('id', 'LimitlessPdfModal' + counter);
});
}
function setResizeEvent() {
// Resize the modal to the right size.
$(window).on('touchstart click resize', function () {
setTimeout(function(){ setTimeout(function(){
$('.pdfIframe').each(function () { $('.pdfIframe').each(function () {
var ModalDialog = $(this).parents('.modal'); var ModalDialog = $(this).parents('.modal');
$(this).height((ModalDialog.height() - 250) + 'px'); $(this).height((ModalDialog.height() - 250) + 'px');
}); });
},300); },300);
}); });
$(document).ready(function() {
}
$(document).ready(function() {
initPdfViewerModalElements();
}); });
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<b><i class="icon-file-pdf"></i></b> {{ $buttonText ?? $title ?? 'No Text' }} <b><i class="icon-file-pdf"></i></b> {{ $buttonText ?? $title ?? 'No Text' }}
</button> </button>
<div id="LimitlessPdfModal" class="modal fade" tabindex="-1"> <div class="LimitlessPdfModal modal fade" tabindex="-1">
<div class="modal-dialog modal-full"> <div class="modal-dialog modal-full">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<div class="modal-body"> <div class="modal-body">
<iframe class="pdfIframe" <iframe class="pdfIframe"
src="https://cdn.backoffice.online/pdfjs/web/viewer.html?file={{ urlencode($url) }}" src="https://cdn.backoffice.online/pdfjs/web/viewer.html?file={{ urlencode($url) }}"
style="border:1px solid #999999;" width="100%"> style="border:1px solid #999999;" width="100%" >
</iframe> </iframe>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment