Is it possible to show a modal
window only if embedded iframe
is fully loaded (an embedded pdf
)?
//triggered by frontend
$scope.onmodal = function() {
$scope.url = "dynamic generated url";
$('#myModal').modal({
show: true, //how to delay?
backdrop: true
});
};
My html: Trigger Modal in iFrame
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="position:inherit !important;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">PDF View</h4>
</div>
<div class="modal-body">
<iframe ng-src="{{url}}" width="300" height="380" frameborder="0" allowtransparency="true"></iframe>
</div>
</div>
</div>
</div>
I want to trigger the modal popup on button click, but delay it until the embedded url (a pdf) has been fully loaded. Because the pdf is generated in the backend, and a long running process (10 sec).
Is it possible?