Skip to content

Commit

Permalink
support AMD (requirejs)
Browse files Browse the repository at this point in the history
  • Loading branch information
unclechu committed Jul 14, 2014
1 parent 6cbe59a commit 1580c78
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions generate/mobile-detect.template.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*global module:false*/
/*global define:false*/

(function (exports, undefined) {
'use strict';
Expand Down Expand Up @@ -547,6 +548,10 @@
data.isPhoneSized = function () {};
module.exports = data;

} else if (typeof define === 'function' && define.amd) {

define(function () { return data; });

} else if (typeof window !== 'undefined') {

data.isPhoneSized = function (maxPhoneWidth) {
Expand Down

0 comments on commit 1580c78

Please sign in to comment.