Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Thornton <jacobthornton@gmail.com>2011-12-21 11:28:48 +0400
committerJacob Thornton <jacobthornton@gmail.com>2011-12-21 11:28:48 +0400
commitf72a94ae2879ebfc5206dd40d5db175e13113850 (patch)
tree449059333026de02121df08ca18bc6fbe6f4d02b /js/bootstrap-modal.js
parentc4364285e456013c4b66308fea86e0f1fb852817 (diff)
update more readme changes - introduce target specificty convention to more plugins
Diffstat (limited to 'js/bootstrap-modal.js')
-rw-r--r--js/bootstrap-modal.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js
index f2624ec1c1..98a62865b3 100644
--- a/js/bootstrap-modal.js
+++ b/js/bootstrap-modal.js
@@ -175,17 +175,16 @@
, options = typeof option == 'object' && option
if (!data) $this.data('modal', (data = new Modal(this, options)))
if (typeof option == 'string') data[option]()
- else if (data.options.show) data.show()
+ else data.show()
})
}
$.fn.modal.defaults = {
backdrop: true
, keyboard: true
- , show: true
}
- $.fn.modal.Modal = Modal
+ $.fn.modal.Constructor = Modal
/* MODAL DATA-API
@@ -194,10 +193,11 @@
$(function () {
$('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
var $this = $(this)
- , target = $this.attr('data-target') || $this.attr('href')
- , option = $(target).data('modal') ? 'toggle' : $this.data()
+ , $target = $($this.attr('data-target') || $this.attr('href'))
+ , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
+
e.preventDefault()
- $(target).modal(option)
+ $target.modal(option)
})
})