diff --git a/js/bootstrap.confirm-modal.js b/js/bootstrap.confirm-modal.js index 89b8eef..c03a915 100644 --- a/js/bootstrap.confirm-modal.js +++ b/js/bootstrap.confirm-modal.js @@ -1,10 +1,14 @@ $(function ( $ ) { + var bootstrap_version = $.fn.collapse.Constructor.VERSION.charAt(0); $.fn.confirmModal = function() { - $(this).unbind('click'); + $(this).unbind('click'); $(this).click(function(ev) { - - template = '
'; + if (bootstrap_version == '3') { + template = ' '; + } else { + template = ' '; + } var data = {'title': '', 'message': '', 'btn_ok': '', 'btn_href': '', 'btn_cancel': ''}; data.title = $(this).data('confirm-title'); @@ -15,7 +19,7 @@ $(function ( $ ) { if (typeof data.title !== 'undefined') { template = template.replace('%%title%%', data.title); - } + } if (typeof data.message !== 'undefined') { template = template.replace('%%message%%', data.message); }