|
@ -1,7 +1,8 @@ |
|
|
// Only load hammer.js when in a browser environment
|
|
|
// Only load hammer.js when in a browser environment
|
|
|
// (loading hammer.js in a node.js environment gives errors)
|
|
|
// (loading hammer.js in a node.js environment gives errors)
|
|
|
if (typeof window !== 'undefined') { |
|
|
if (typeof window !== 'undefined') { |
|
|
module.exports = require('hammerjs'); |
|
|
|
|
|
|
|
|
module.exports = window['Hammer'] || require('hammerjs'); |
|
|
|
|
|
// TODO: throw an error when hammerjs is not available?
|
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
module.exports = function () { |
|
|
module.exports = function () { |
|
|