From c8c4d5b3925b033723a3f589db9c579b37ca5ceb Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Mon, 6 Feb 2012 00:17:31 -0800 Subject: fix alert tests + add show option back to modals --- docs/assets/js/bootstrap-modal.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'docs/assets/js/bootstrap-modal.js') diff --git a/docs/assets/js/bootstrap-modal.js b/docs/assets/js/bootstrap-modal.js index ba64368b2d..180f0b64d9 100644 --- a/docs/assets/js/bootstrap-modal.js +++ b/docs/assets/js/bootstrap-modal.js @@ -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 -- cgit v1.2.3