1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05: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,31 +3,30 @@
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874) /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */ * ======================================================= */
$.support.transition = (function () {
var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
return support
})()
/* SHARED VARS
* =========== */
var transitionEnd var transitionEnd
// set CSS transition event type $(function () {
if ( $.support.transition ) {
transitionEnd = "TransitionEnd"
if ( $.browser.webkit ) {
transitionEnd = "webkitTransitionEnd"
} else if ( $.browser.mozilla ) {
transitionEnd = "transitionend"
} else if ( $.browser.opera ) {
transitionEnd = "oTransitionEnd"
}
}
$.support.transition = (function () {
var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
return support
})()
// set CSS transition event type
if ( $.support.transition ) {
transitionEnd = "TransitionEnd"
if ( $.browser.webkit ) {
transitionEnd = "webkitTransitionEnd"
} else if ( $.browser.mozilla ) {
transitionEnd = "transitionend"
} else if ( $.browser.opera ) {
transitionEnd = "oTransitionEnd"
}
}
})
/* 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

@ -1,33 +1,32 @@
(function( $ ){ (function( $ ){
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874) /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */ * ======================================================= */
$.support.transition = (function () { var transitionEnd
var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
return support
})()
$(function () {
/* SHARED VARS $.support.transition = (function () {
* =========== */ var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
return support
})()
var $window = $('body') // set CSS transition event type
, transitionEnd if ( $.support.transition ) {
transitionEnd = "TransitionEnd"
// set CSS transition event type if ( $.browser.webkit ) {
if ( $.support.transition ) { transitionEnd = "webkitTransitionEnd"
transitionEnd = "TransitionEnd" } else if ( $.browser.mozilla ) {
if ( $.browser.webkit ) { transitionEnd = "transitionend"
transitionEnd = "webkitTransitionEnd" } else if ( $.browser.opera ) {
} else if ( $.browser.mozilla ) { transitionEnd = "oTransitionEnd"
transitionEnd = "transitionend" }
} else if ( $.browser.opera ) {
transitionEnd = "oTransitionEnd"
} }
}
})
/* 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

@ -2,33 +2,33 @@
(function( $ ) { (function( $ ) {
/* CSS TRANSITION SUPPORT (https://gist.github.com/373874) /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */ * ======================================================= */
$.support.transition = (function () {
var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
return support
})()
/* SHARED VARS
* =========== */
var transitionEnd var transitionEnd
// set CSS transition event type $(function () {
if ( $.support.transition ) {
transitionEnd = "TransitionEnd" $.support.transition = (function () {
if ( $.browser.webkit ) { var thisBody = document.body || document.documentElement
transitionEnd = "webkitTransitionEnd" , thisStyle = thisBody.style
} else if ( $.browser.mozilla ) { , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
transitionEnd = "transitionend" return support
} else if ( $.browser.opera ) { })()
transitionEnd = "oTransitionEnd"
// set CSS transition event type
if ( $.support.transition ) {
transitionEnd = "TransitionEnd"
if ( $.browser.webkit ) {
transitionEnd = "webkitTransitionEnd"
} else if ( $.browser.mozilla ) {
transitionEnd = "transitionend"
} else if ( $.browser.opera ) {
transitionEnd = "oTransitionEnd"
}
} }
}
})
/* TWIPSY PUBLIC CLASS DEFINITION /* TWIPSY PUBLIC CLASS DEFINITION