Skip to content

Commit

Permalink
Refs twbs#5161: Maintains backwards compatibility while allowing for …
Browse files Browse the repository at this point in the history
…remote content that contains model header, body and footer.

Refs twbs#7149: Maintains backwards compatibility while allowing for remote content that contains model header, body and footer.
  • Loading branch information
Alex Hayes committed Mar 22, 2013
1 parent 37d0a30 commit 3edf995
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/bootstrap-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
this.options = options
this.$element = $(element)
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
if (this.$element.find('.modal-body').length == 0) {
this.options.remote && this.$element.load(this.options.remote)
} else {
this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
}
}

Modal.prototype = {
Expand Down

2 comments on commit 3edf995

@pjungwir
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really nice fix. Do you think you could submit a pull request back to upstream?

@ekenman
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is awesome. I'd also like to see this. Perhaps in version 3?

Please sign in to comment.