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:
12
js/bootstrap-button.js
vendored
12
js/bootstrap-button.js
vendored
@@ -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 )
|
Reference in New Issue
Block a user