0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-03-15 15:29:22 +01:00

wrap for domready

This commit is contained in:
Jacob Thornton 2011-08-28 16:47:38 -07:00
parent a0cb72f9ae
commit f1d17223b8
4 changed files with 71 additions and 71 deletions

View File

@ -3,6 +3,10 @@
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874) /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */ * ======================================================= */
var transitionEnd
$(function () {
$.support.transition = (function () { $.support.transition = (function () {
var thisBody = document.body || document.documentElement var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style , thisStyle = thisBody.style
@ -10,12 +14,6 @@
return support return support
})() })()
/* SHARED VARS
* =========== */
var transitionEnd
// set CSS transition event type // set CSS transition event type
if ( $.support.transition ) { if ( $.support.transition ) {
transitionEnd = "TransitionEnd" transitionEnd = "TransitionEnd"
@ -28,6 +26,7 @@
} }
} }
})
/* ALERT CLASS DEFINITION /* ALERT CLASS DEFINITION
* ====================== */ * ====================== */

View File

@ -7,7 +7,9 @@
$('a.menu').parent('li').removeClass('open') $('a.menu').parent('li').removeClass('open')
} }
$('body').bind("click", clearMenus) $(function () {
$(window).bind("click", clearMenus)
})
$.fn.dropdown = function ( options ) { $.fn.dropdown = function ( options ) {
return this.each(function () { return this.each(function () {

View File

@ -3,6 +3,10 @@
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874) /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */ * ======================================================= */
var transitionEnd
$(function () {
$.support.transition = (function () { $.support.transition = (function () {
var thisBody = document.body || document.documentElement var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style , thisStyle = thisBody.style
@ -10,13 +14,6 @@
return support return support
})() })()
/* SHARED VARS
* =========== */
var $window = $('body')
, transitionEnd
// set CSS transition event type // set CSS transition event type
if ( $.support.transition ) { if ( $.support.transition ) {
transitionEnd = "TransitionEnd" transitionEnd = "TransitionEnd"
@ -29,6 +26,8 @@
} }
} }
})
/* MODAL PUBLIC CLASS DEFINITION /* MODAL PUBLIC CLASS DEFINITION
* ============================= */ * ============================= */
@ -127,13 +126,13 @@
, escape: function () { , escape: function () {
var that = this var that = this
if ( this.isOpen && this.settings.closeOnEscape ) { if ( this.isOpen && this.settings.closeOnEscape ) {
$window.bind('keyup.modal.escape', function ( e ) { $(window).bind('keyup.modal.escape', function ( e ) {
if ( e.which == 27 ) { if ( e.which == 27 ) {
that.close() that.close()
} }
}) })
} else if ( !this.isOpen ) { } else if ( !this.isOpen ) {
$window.unbind('keyup.modal.escape') $(window).unbind('keyup.modal.escape')
} }
} }

View File

@ -5,6 +5,10 @@
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874) /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */ * ======================================================= */
var transitionEnd
$(function () {
$.support.transition = (function () { $.support.transition = (function () {
var thisBody = document.body || document.documentElement var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style , thisStyle = thisBody.style
@ -12,12 +16,6 @@
return support return support
})() })()
/* SHARED VARS
* =========== */
var transitionEnd
// set CSS transition event type // set CSS transition event type
if ( $.support.transition ) { if ( $.support.transition ) {
transitionEnd = "TransitionEnd" transitionEnd = "TransitionEnd"
@ -30,6 +28,8 @@
} }
} }
})
/* TWIPSY PUBLIC CLASS DEFINITION /* TWIPSY PUBLIC CLASS DEFINITION
* ============================== */ * ============================== */