Skip to content

fix RequireJS compatibility #581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix RequireJS compatibility
  • Loading branch information
stebunovd committed Apr 18, 2014
commit fa7ab756946d25771d17755c8cc063197ff0b57c
6 changes: 3 additions & 3 deletions debug_toolbar/static/debug_toolbar/js/toolbar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as anonymous module.
define(['jquery'], factory);
if (typeof define === 'function' && define.amd && typeof require === 'function') {
// RequireJS, use jQuery from its config
require(['jquery'], factory);
} else {
// Browser globals.
window.djdt = factory(jQuery);
Expand Down
5 changes: 3 additions & 2 deletions debug_toolbar/static/debug_toolbar/js/toolbar.profiling.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
if (typeof define === 'function' && define.amd && typeof require === 'function') {
// RequireJS, use jQuery from its config
require(['jquery'], factory);
} else {
factory(jQuery);
}
Expand Down
5 changes: 3 additions & 2 deletions debug_toolbar/static/debug_toolbar/js/toolbar.sql.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
if (typeof define === 'function' && define.amd && typeof require === 'function') {
// RequireJS, use jQuery from its config
require(['jquery'], factory);
} else {
factory(jQuery);
}
Expand Down
5 changes: 3 additions & 2 deletions debug_toolbar/static/debug_toolbar/js/toolbar.template.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
if (typeof define === 'function' && define.amd && typeof require === 'function') {
// RequireJS, use jQuery from its config
require(['jquery'], factory);
} else {
factory(jQuery);
}
Expand Down
5 changes: 3 additions & 2 deletions debug_toolbar/static/debug_toolbar/js/toolbar.timer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
if (typeof define === 'function' && define.amd && typeof require === 'function') {
// RequireJS, use jQuery from its config
require(['jquery'], factory);
} else {
factory(jQuery);
}
Expand Down