1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-05 21:27:31 +02:00

giant refactor - all spec passing again...

This commit is contained in:
Jacob Thornton
2011-12-20 18:02:47 -08:00
parent 7df0d1c7d1
commit 1ef5fa7d6b
27 changed files with 9618 additions and 390 deletions

View File

@@ -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 )
}( window.jQuery )