Skip to content
This repository was archived by the owner on Apr 2, 2019. It is now read-only.

Commit 6fe21ed

Browse files
committed
Merge pull request #578 from ryno1234/master
Populating Backbone.$ with jquery for CommonJS requires
2 parents 3b9f08c + ef2e9e5 commit 6fe21ed

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

Gruntfile.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ module.exports = function (grunt) {
5050
' });\n' +
5151
' } else if (typeof exports === "object") {\n' +
5252
' // CommonJS\n' +
53-
' module.exports = factory(require("underscore"), require("backbone"));\n' +
53+
' var Backbone = require("backbone");\n' +
54+
' Backbone.$ = Backbone.$ || require("jquery");\n' +
55+
' module.exports = factory(require("underscore"), Backbone);\n' +
5456
' } else {\n' +
5557
' // Browser\n' +
5658
' root.Backgrid = factory(root._, root.Backbone);\n' +

lib/backgrid.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
backgrid 0.3.5
33
http://github.com/wyuenho/backgrid
44
5-
Copyright (c) 2014 Jimmy Yuen Ho Wong and contributors <wyuenho@gmail.com>
5+
Copyright (c) 2015 Jimmy Yuen Ho Wong and contributors <wyuenho@gmail.com>
66
Licensed under the MIT license.
77
*/
88

@@ -15,7 +15,9 @@
1515
});
1616
} else if (typeof exports === "object") {
1717
// CommonJS
18-
module.exports = factory(require("underscore"), require("backbone"));
18+
var Backbone = require("backbone");
19+
Backbone.$ = Backbone.$ || require("jquery");
20+
module.exports = factory(require("underscore"), Backbone);
1921
} else {
2022
// Browser
2123
root.Backgrid = factory(root._, root.Backbone);

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,10 @@
3333
"engines": {
3434
"node": ">=0.10"
3535
},
36-
"private": true
36+
"private": true,
37+
"dependencies": {
38+
"backbone": "^1.1.2",
39+
"jquery": "^2.1.4",
40+
"underscore": "^1.8.3"
41+
}
3742
}

0 commit comments

Comments
 (0)