Commit f1d17223 authored by Jacob Thornton's avatar Jacob Thornton

wrap for domready

parent a0cb72f9
...@@ -3,6 +3,10 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -28,6 +26,7 @@
} }
} }
})
/* 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 () {
......
...@@ -3,6 +3,10 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -29,6 +26,8 @@
} }
} }
})
/* 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')
} }
} }
......
...@@ -5,6 +5,10 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -30,6 +28,8 @@
} }
} }
})
/* 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