|
@ -5,4 +5,14 @@ |
|
|
// Try to load dependencies from the global window object.
|
|
|
// Try to load dependencies from the global window object.
|
|
|
// If not available there, load via require.
|
|
|
// If not available there, load via require.
|
|
|
var moment = (typeof window !== 'undefined') && window['moment'] || require('moment'); |
|
|
var moment = (typeof window !== 'undefined') && window['moment'] || require('moment'); |
|
|
var Hammer = (typeof window !== 'undefined') && window['Hammer'] || require('hammerjs'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Hammer; |
|
|
|
|
|
if (typeof window !== 'undefined') { |
|
|
|
|
|
// load hammer.js only when running in a browser (where window is available)
|
|
|
|
|
|
Hammer = window['Hammer'] || require('hammerjs'); |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
Hammer = function () { |
|
|
|
|
|
throw Error('hammer.js is only available in a browser, not in node.js.'); |
|
|
|
|
|
} |
|
|
|
|
|
} |