make on prev js changes

This commit is contained in:
Mark Otto 2013-07-17 23:33:34 -07:00
parent 451acb42db
commit ba0c6cd57c
2 changed files with 8 additions and 7 deletions

View File

@ -804,7 +804,7 @@
var Modal = function (element, options) {
this.options = options
this.$element = $(element).delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
this.$element = $(element).on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
this.$backdrop =
this.isShown = null
@ -939,11 +939,12 @@
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.appendTo(document.body)
this.$backdrop.click(
this.options.backdrop == 'static' ?
$.proxy(this.$element[0].focus, this.$element[0])
: $.proxy(this.hide, this)
)
this.$element.on('click', $.proxy(function (e) {
if (e.target !== e.currentTarget) return
this.options.backdrop == 'static'
? this.$element[0].focus.call(this.$element[0])
: this.hide.call(this)
}, this))
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow

File diff suppressed because one or more lines are too long