0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-21 18:54:30 +01:00

honor data attributes set on modal as well

This commit is contained in:
Jacob Thornton 2012-02-12 11:15:12 -08:00
parent d7953a8f1e
commit 5b4a29d84e
3 changed files with 2 additions and 2 deletions

Binary file not shown.

View File

@ -177,7 +177,7 @@
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
, data = $this.data('modal') , 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 (!data) $this.data('modal', (data = new Modal(this, options)))
if (typeof option == 'string') data[option]() if (typeof option == 'string') data[option]()
else if (options.show) data.show() else if (options.show) data.show()

View File

@ -177,7 +177,7 @@
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
, data = $this.data('modal') , 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 (!data) $this.data('modal', (data = new Modal(this, options)))
if (typeof option == 'string') data[option]() if (typeof option == 'string') data[option]()
else if (options.show) data.show() else if (options.show) data.show()