Skip to content

Commit e394703

Browse files
committed
Merge pull request #22 from angelaigreja/patch-1
Allow the module to be used in Universal apps
2 parents 4153ef3 + 92bd79e commit e394703

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lib/index.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
'use strict';
22

33
var React = require('react');
4-
var $ = require('./bootstrap-multiselect.js').init(
5-
require('./bootstrap-dropdown.js').init(
6-
require('jquery')
7-
)
8-
);
4+
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
5+
//Necessary for Universal Javascript apps
6+
//since JQuery requires a working window
7+
var $ = require('./bootstrap-multiselect.js').init(
8+
require('./bootstrap-dropdown.js').init(
9+
require('jquery')
10+
)
11+
);
12+
}
913
var getOptions = require('./get-options.js');
1014

1115
/* this is our exported React class */

0 commit comments

Comments
 (0)