mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-26 05:19:15 +02:00
fix alert tests + add show option back to modals
This commit is contained in:
7
docs/assets/js/bootstrap-modal.js
vendored
7
docs/assets/js/bootstrap-modal.js
vendored
@@ -26,7 +26,7 @@
|
||||
* ====================== */
|
||||
|
||||
var Modal = function ( content, options ) {
|
||||
this.options = $.extend({}, $.fn.modal.defaults, options)
|
||||
this.options = options
|
||||
this.$element = $(content)
|
||||
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
|
||||
}
|
||||
@@ -177,16 +177,17 @@
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('modal')
|
||||
, options = typeof option == 'object' && option
|
||||
, options = $.extend({}, $.fn.modal.defaults, typeof option == 'object' && option)
|
||||
if (!data) $this.data('modal', (data = new Modal(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
else data.show()
|
||||
else if (options.show) data.show()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.modal.defaults = {
|
||||
backdrop: true
|
||||
, keyboard: true
|
||||
, show: true
|
||||
}
|
||||
|
||||
$.fn.modal.Constructor = Modal
|
||||
|
Reference in New Issue
Block a user