mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-19 16:54:24 +01:00
honor data attributes set on modal as well
This commit is contained in:
parent
d7953a8f1e
commit
5b4a29d84e
Binary file not shown.
2
docs/assets/js/bootstrap-modal.js
vendored
2
docs/assets/js/bootstrap-modal.js
vendored
@ -177,7 +177,7 @@
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('modal')
|
||||
, options = $.extend({}, $.fn.modal.defaults, 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 if (options.show) data.show()
|
||||
|
2
js/bootstrap-modal.js
vendored
2
js/bootstrap-modal.js
vendored
@ -177,7 +177,7 @@
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('modal')
|
||||
, options = $.extend({}, $.fn.modal.defaults, 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 if (options.show) data.show()
|
||||
|
Loading…
x
Reference in New Issue
Block a user