From 1ef5fa7d6b4e50230c0c12919b0a06a9a2ac07f1 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Tue, 20 Dec 2011 18:02:47 -0800 Subject: giant refactor - all spec passing again... --- js/bootstrap-button.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'js/bootstrap-button.js') diff --git a/js/bootstrap-button.js b/js/bootstrap-button.js index 4ed24d98b..508835a38 100644 --- a/js/bootstrap-button.js +++ b/js/bootstrap-button.js @@ -24,16 +24,16 @@ /* BUTTON PUBLIC CLASS DEFINITION * ============================== */ - var Button = function (element, options) { + var Button = function ( element, options ) { this.$element = $(element) - this.settings = $.extend({}, $.fn.button.defaults, options) + this.options = $.extend({}, $.fn.button.defaults, options) } Button.prototype = { constructor: Button - , setState: function (state) { + , setState: function ( state ) { var d = 'disabled' , $el = this.$element , data = $el.data() @@ -42,7 +42,7 @@ state = state + 'Text' data.resetText || $el.data('resetText', $el[val]()) - $el[val](data[state] || this.settings[state]) + $el[val](data[state] || this.options[state]) // push to event loop to allow forms to submit setTimeout(function () { @@ -90,9 +90,9 @@ * =============== */ $(function () { - $('body').delegate('[data-toggle^=button]', 'click.button.data-api', function (e) { + $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) { $(e.srcElement).button('toggle') }) }) -}( window.jQuery || window.ender ) \ No newline at end of file +}( window.jQuery ) \ No newline at end of file -- cgit v1.2.3 From f72a94ae2879ebfc5206dd40d5db175e13113850 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Tue, 20 Dec 2011 23:28:48 -0800 Subject: update more readme changes - introduce target specificty convention to more plugins --- js/bootstrap-button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/bootstrap-button.js') diff --git a/js/bootstrap-button.js b/js/bootstrap-button.js index 508835a38..10a85835e 100644 --- a/js/bootstrap-button.js +++ b/js/bootstrap-button.js @@ -83,7 +83,7 @@ loadingText: 'loading...' } - $.fn.button.Button = Button + $.fn.button.Constructor = Button /* BUTTON DATA-API -- cgit v1.2.3