Skip to content

Commit

Permalink
Fix bootstrap 4 styling issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gerryd committed Jul 8, 2020
1 parent e91adbf commit f0b0b7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tigron-confirm-modal",
"version": "0.0.3",
"version": "0.0.4",
"homepage": "https://github.com/tigron/confirm-modal",
"authors": [
"Christophe Gosiau <[email protected]>"
Expand Down
6 changes: 4 additions & 2 deletions js/bootstrap.confirm-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ $(function ( $ ) {
$.fn.confirmModal = function() {
$(this).unbind('click');
$(this).click(function(ev) {
if (bootstrap_version == '3') {
if (bootstrap_version == '4') {
template = '<div id="dataConfirmModal" class="modal fade" role="dialog" aria-labelledby="dataConfirmLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><h4 class="modal-title">%%title%%</h4><button type="button" class="close" data-dismiss="modal">x</button></div><div class="modal-body"><p>%%message%%</p></div><div class="modal-footer"><a class="btn btn-primary" href="%%btn_href%%" id="data-confirm-ok">%%btn_ok%%</a><a class="btn btn-outline-secondary" data-dismiss="modal" aria-hidden="true" id="data-confirm-cancel">%%btn_cancel%%</a></div></div></div></div>';
} else if (bootstrap_version == '3') {
template = '<div id="dataConfirmModal" class="modal fade" role="dialog" aria-labelledby="dataConfirmLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><h4 class="modal-title">%%title%%</h4><button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button></div><div class="modal-body"><p>%%message%%</p></div><div class="modal-footer"><a class="btn btn-primary" href="%%btn_href%%" id="data-confirm-ok">%%btn_ok%%</a><a class="btn btn-default" data-dismiss="modal" aria-hidden="true" id="data-confirm-cancel">%%btn_cancel%%</a></div></div></div></div>';
} else {
template = '<div id="dataConfirmModal" class="modal fade" role="dialog" aria-labelledby="dataConfirmLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><h4 class="modal-title">%%title%%</h4><button type="button" class="modal-close" data-dismiss="modal" aria-label="Close">x</button></div><div class="modal-body"><p>%%message%%</p></div><div class="modal-footer"><a class="btn btn-primary" href="%%btn_href%%" id="data-confirm-ok">%%btn_ok%%</a><a class="btn btn-default" data-dismiss="modal" aria-hidden="true" id="data-confirm-cancel">%%btn_cancel%%</a></div></div></div></div>';
Expand All @@ -26,7 +28,7 @@ $(function ( $ ) {
if (typeof data.btn_ok !== 'undefined') {
template = template.replace('%%btn_ok%%', data.btn_ok);
} else {
template = template.replace('%%btn_ok%%', 'Ok');
template = template.replace('%%btn_ok%%', 'OK');
}
if (typeof data.btn_cancel !== 'undefined') {
template = template.replace('%%btn_cancel%%', data.btn_cancel);
Expand Down

0 comments on commit f0b0b7a

Please sign in to comment.