Skip to content

Commit

Permalink
Merge pull request #243 from aspiers/fix/commonjs
Browse files Browse the repository at this point in the history
fix CommonJS support (fixes #242)
  • Loading branch information
needim committed Jan 17, 2015
2 parents d93ecb6 + 33bbbbd commit 560767e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = function(grunt) {
src: 'js/noty/packaged/jquery.noty.packaged.js',
dest: 'js/noty/packaged/jquery.noty.packaged.js',
options: {
wrapper: ["!function(root, factory) {\n\t if (typeof define === 'function' && define.amd) {\n\t\t define(['jquery'], factory);\n\t } else {\n\t\t factory(root.jQuery);\n } }(this, function($) {\n", "\n});"]
wrapper: ["!function(root, factory) {\n\t if (typeof define === 'function' && define.amd) {\n\t\t define(['jquery'], factory);\n\t } else if (typeof exports === 'object') {\n\t\t module.exports = factory(require('jquery'));\n\t } else {\n\t\t factory(root.jQuery);\n\t }\n}(this, function($) {\n", "\nreturn window.noty;\n\n});"]
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions js/noty/jquery.noty.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,5 +530,5 @@

// Helpers
window.noty = function noty(options) {
return jQuery.notyRenderer.init(options);
};
return $.notyRenderer.init(options);
};
10 changes: 8 additions & 2 deletions js/noty/packaged/jquery.noty.packaged.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
!function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else if (typeof exports === 'object') {
module.exports = factory(require('jquery'));
} else {
factory(root.jQuery);
} }(this, function($) {
}
}(this, function($) {

/*!
@package noty - jQuery Notification Plugin
Expand Down Expand Up @@ -537,8 +540,9 @@

// Helpers
window.noty = function noty(options) {
return jQuery.notyRenderer.init(options);
return $.notyRenderer.init(options);
};

$.noty.layouts.bottom = {
name : 'bottom',
options : {},
Expand Down Expand Up @@ -1427,4 +1431,6 @@ $.noty.themes.relax = {
};


return window.noty;

});
2 changes: 1 addition & 1 deletion js/noty/packaged/jquery.noty.packaged.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"type": "git",
"url": "git://github.com/needim/noty.git"
},
"main": "js/noty/packaged/jquery.noty.packaged.js",
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.5",
Expand Down

0 comments on commit 560767e

Please sign in to comment.