Skip to content

Commit

Permalink
Check for existence of window to allow for use outside of the browser
Browse files Browse the repository at this point in the history
Added existence check for window to allow loading Spine from an
environment without a window object
  • Loading branch information
teamtreehouse committed Jan 18, 2012
1 parent 0a9b734 commit 611ef8c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/spine.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/spine.coffee
Expand Up @@ -470,7 +470,7 @@ class Controller extends Module

# Utilities & Shims

$ = window.jQuery or window.Zepto or (element) -> element
$ = window?.jQuery or window?.Zepto or (element) -> element

unless typeof Object.create is 'function'
Object.create = (o) ->
Expand Down Expand Up @@ -527,4 +527,4 @@ Model.setup = (name, attributes = []) ->
Module.init = Controller.init = Model.init = (a1, a2, a3, a4, a5) ->
new this(a1, a2, a3, a4, a5)

Spine.Class = Module
Spine.Class = Module

0 comments on commit 611ef8c

Please sign in to comment.