Skip to content

Commit

Permalink
ability to add buttons to footer
Browse files Browse the repository at this point in the history
  • Loading branch information
Valdas Kalvaitis committed Sep 29, 2015
1 parent 2f7ee78 commit 1e3faa2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/modal.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,19 @@
var title = $(this).data('title') || 'Delete';
var text = $(this).data('text') || 'Are you sure you want to remove this item?';
var that = this;
var buttons = $('#bsModalConfirmButtons');

displayDefaultContent($('#bsModalConfirmContent'));

modalContent.find('#bsModalTitle').html(title);
modalContent.find('.modal-body').html(text + $('#bsModalConfirmButtons').html());

if (buttons.data('append')) {
modalContent.find('.modal-body').html(text);
modalContent.find('.modal-content').append(buttons.html());
} else {
modalContent.find('.modal-body').html(text + buttons.html());
}

modal.modal('show');

modalContent.find('.js-confirm-btn').off().on('click', function() {
Expand Down

0 comments on commit 1e3faa2

Please sign in to comment.