Prevent modal inception

This commit is contained in:
Tom Price
2015-05-29 01:46:12 +01:00
parent ac106ef864
commit 4846d858aa

View File

@@ -172,12 +172,14 @@
<script> <script>
jQuery(document).ready(function () { jQuery(document).ready(function () {
jQuery(document).on('click', '.modal-href', function (e) { jQuery(document).on('click', '.modal-href', function (e) {
e.preventDefault() $link = jQuery(this);
modaltarget = jQuery(this).data('target') // Anti modal inception
modalobject = ""; if($link.parents('#modal').length == 0) {
jQuery('#modal').load(jQuery(this).attr('href'), function (e) { e.preventDefault();
jQuery('#modal').modal(); jQuery('#modal').load($link.attr('href'), function (e) {
}); jQuery('#modal').modal();
});
}
}); });