Skip to content

Commit

Permalink
Merge pull request #342 from jantimon/master
Browse files Browse the repository at this point in the history
Fixes issue #331 -  "jquery.hammer.js can't used in requirejs"
  • Loading branch information
jtangelder committed Sep 3, 2013
2 parents 5f95703 + afc7e15 commit 74c85b3
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dist/hammer.js
Expand Up @@ -1421,7 +1421,7 @@ Hammer.gestures.Release = {
// some AMD build optimizers, like r.js, check for specific condition patterns like the following:
if(typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
// define as an anonymous module
define(function() {
define('hammer', function() {
return Hammer;
});
}
Expand Down
21 changes: 16 additions & 5 deletions dist/jquery.hammer.js
Expand Up @@ -1421,7 +1421,7 @@ Hammer.gestures.Release = {
// some AMD build optimizers, like r.js, check for specific condition patterns like the following:
if(typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
// define as an anonymous module
define(function() {
define('hammer', function() {
return Hammer;
});
}
Expand All @@ -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', ['hammer', 'jquery'], init);
} else {
init(window.Hammer, window.jQuery || window.Zepto);
}

}());

0 comments on commit 74c85b3

Please sign in to comment.