Skip to content

Commit

Permalink
common js support
Browse files Browse the repository at this point in the history
  • Loading branch information
dmotz committed Apr 29, 2015
1 parent 9e9081a commit 151afb3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions hexaflip.coffee
Expand Up @@ -32,7 +32,7 @@ faceNames = ['front', 'bottom', 'back', 'top', 'left', 'right']
faceSequence = faceNames[...4]
urlRx = /(^(?:(?:(?:(?:https?)|(?:file)):)?\/\/)|^(?:data:)|^(?:(?:\.\.?)?\/))(?:.+)/i

class window.HexaFlip
class HexaFlip

constructor: (@el, @sets, @options = {}) ->
return unless css.transform and @el
Expand Down Expand Up @@ -298,7 +298,15 @@ class window.HexaFlip
@flip true


return unless ($ = window.jQuery or window.$) and $.data
if module?.exports
module.exports = HexaFlip
else if define?.amd
define -> HexaFlip
else
window.HexaFlip = HexaFlip

return unless window? and ($ = window.jQuery or window.$) and $.data

$::hexaFlip = (sets, options) ->
return @ unless css.transform
if typeof sets is 'string'
Expand Down

0 comments on commit 151afb3

Please sign in to comment.