vendor/assets/javascripts/bootstrap-modal.js in bootstrap-sass-2.0.0 vs vendor/assets/javascripts/bootstrap-modal.js in bootstrap-sass-2.0.1
- old
+ new
@@ -1,7 +1,7 @@
/* =========================================================
- * bootstrap-modal.js v2.0.0
+ * bootstrap-modal.js v2.0.1
* http://twitter.github.com/bootstrap/javascript.html#modals
* =========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,11 +24,11 @@
/* MODAL CLASS DEFINITION
* ====================== */
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))
}
Modal.prototype = {
@@ -175,20 +175,21 @@
$.fn.modal = function ( option ) {
return this.each(function () {
var $this = $(this)
, data = $this.data('modal')
- , options = typeof option == 'object' && option
+ , options = $.extend({}, $.fn.modal.defaults, $this.data(), 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
@@ -204,6 +205,6 @@
e.preventDefault()
$target.modal(option)
})
})
-}( window.jQuery )
+}( window.jQuery );
\ No newline at end of file