Skip to content

Commit

Permalink
Fixes issue hammerjs#331 - "jquery.hammer.js can't used in requirejs"
Browse files Browse the repository at this point in the history
  • Loading branch information
jantimon committed Aug 11, 2013
1 parent c9b41c1 commit c9711ac
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 10 deletions.
19 changes: 15 additions & 4 deletions dist/jquery.hammer.js
Expand Up @@ -1435,12 +1435,13 @@ else {
})(this);


(function($, undefined) {
'use strict';
(function(undefined) {
'use strict';
var init = function(Hammer, $) {

// no jQuery or Zepto!
if($ === undefined) {
return;
return Hammer;
}

/**
Expand Down Expand Up @@ -1541,4 +1542,14 @@ else {
});
};

})(window.jQuery || window.Zepto);
return Hammer;
};


if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
define(["hammer", "jquery"], init);
} else {
init(window.Hammer, window.jQuery || window.Zepto);
}

}());

0 comments on commit c9711ac

Please sign in to comment.