In most cases, the modal dialog is constructed not using Javascript, rather it’s using the markup, in this scenario, just add attribute: data-backdrop=”static” in the div that has class=”modal fade”.
Example:
<div class="modal fade" id="myModal" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">