Skip to content

Commit

Permalink
Expose as nodejs component
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneier committed Aug 28, 2018
1 parent f22194d commit 12d422a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion build/js/countrySelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
define([ "jquery" ], function($) {
factory($, window, document);
});
} else if (typeof module === "object" && module.exports) {
module.exports = factory(require("jquery"), window, document);
} else {
factory(jQuery, window, document);
}
Expand Down Expand Up @@ -238,7 +240,9 @@
if (this.options.initialCountry === "auto") {
this._loadAutoCountry();
} else {
this.selectCountry(this.defaultCountry);
if (this.defaultCountry) {
this.selectCountry(this.defaultCountry);
}
this.autoCountryDeferred.resolve();
}
},
Expand Down
2 changes: 1 addition & 1 deletion build/js/countrySelect.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./build/js/countrySelect.js');
2 changes: 2 additions & 0 deletions src/js/countrySelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
define([ "jquery" ], function($) {
factory($, window, document);
});
} else if (typeof module === "object" && module.exports) {
module.exports = factory(require("jquery"), window, document);
} else {
factory(jQuery, window, document);
}
Expand Down

0 comments on commit 12d422a

Please sign in to comment.