Skip to content

Commit

Permalink
Refs twbs#5161: Added option 'remoteinbody' to control whether the re…
Browse files Browse the repository at this point in the history
…mote should be placed in the body or not. Set data-remoteinbody="false" to control via markup.
  • Loading branch information
Alex Hayes committed Jul 17, 2013
1 parent 3edf995 commit e541840
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions js/bootstrap-modal.js
Expand Up @@ -30,10 +30,10 @@
this.options = options
this.$element = $(element)
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
if (this.$element.find('.modal-body').length == 0) {
this.options.remote && this.$element.load(this.options.remote)
} else {
if (this.options.remoteinbody) {
this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
} else {
this.options.remote && this.$element.load(this.options.remote)
}
}

Expand Down Expand Up @@ -103,6 +103,7 @@
this.$element
.removeClass('in')
.attr('aria-hidden', true)
.removeData('modal')

$.support.transition && this.$element.hasClass('fade') ?
this.hideWithTransition() :
Expand Down Expand Up @@ -216,6 +217,7 @@
backdrop: true
, keyboard: true
, show: true
, remoteinbody: true
}

$.fn.modal.Constructor = Modal
Expand Down

0 comments on commit e541840

Please sign in to comment.