1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-27 22:09:04 +02:00

add jshint support + a few minor stylistic changes

This commit is contained in:
Jacob Thornton
2012-04-14 16:29:53 -07:00
parent 8575a45294
commit 575f18aaf4
29 changed files with 317 additions and 273 deletions

View File

@@ -18,14 +18,15 @@
* ========================================================= */
!function ( $ ) {
!function ($) {
"use strict"; // jshint ;_;
"use strict"
/* MODAL CLASS DEFINITION
* ====================== */
var Modal = function ( content, options ) {
var Modal = function (content, options) {
this.options = options
this.$element = $(content)
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
@@ -55,7 +56,9 @@
backdrop.call(this, function () {
var transition = $.support.transition && that.$element.hasClass('fade')
!that.$element.parent().length && that.$element.appendTo(document.body) //don't move modals dom position
if (!that.$element.parent().length) {
that.$element.appendTo(document.body) //don't move modals dom position
}
that.$element
.show()
@@ -73,7 +76,7 @@
})
}
, hide: function ( e ) {
, hide: function (e) {
e && e.preventDefault()
var that = this
@@ -116,7 +119,7 @@
})
}
function hideModal( that ) {
function hideModal(that) {
this.$element
.hide()
.trigger('hidden')
@@ -124,7 +127,7 @@
backdrop.call(this)
}
function backdrop( callback ) {
function backdrop(callback) {
var that = this
, animate = this.$element.hasClass('fade') ? 'fade' : ''
@@ -178,7 +181,7 @@
/* MODAL PLUGIN DEFINITION
* ======================= */
$.fn.modal = function ( option ) {
$.fn.modal = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('modal')
@@ -212,4 +215,4 @@
})
})
}( window.jQuery );
}(window.jQuery);