Commit f1d17223 authored by Jacob Thornton's avatar Jacob Thornton

wrap for domready

parent a0cb72f9
...@@ -3,31 +3,30 @@ ...@@ -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" $.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"
}
}
})
/* ALERT CLASS DEFINITION /* ALERT CLASS DEFINITION
* ====================== */ * ====================== */
......
...@@ -7,7 +7,9 @@ ...@@ -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 () {
......
(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 $(function () {
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
return support $.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
/* SHARED VARS 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 @@ ...@@ -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')
} }
} }
......
...@@ -2,33 +2,33 @@ ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment