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 () {
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()

View File

@ -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()