Skip to content

Commit 3522c09

Browse files
committed
improve browser environment check
1 parent c6922f2 commit 3522c09

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

widgster.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@
44
( function( global, factory ) {
55
"use strict";
66

7-
if ( typeof module === "object"
8-
&& typeof module.exports === "object"
9-
|| !global.document
10-
|| !global.jQuery) {
11-
console.warn( "Widgster must be executed in a browser environment with jQuery defined" );
7+
if (global.jQuery && global.jQuery.fn) {
8+
factory(global.jQuery);
129
} else {
13-
factory( global.jQuery );
10+
console.warn("Widgster must be executed in a browser environment with jQuery defined");
1411
}
1512
} )( typeof window !== "undefined" ? window : this, function( $ ) {
16-
// WIDGSTER CLASS DEFINITION
13+
// WIDGSTER CLASS DEFINITION
1714
// ======================
1815

1916
var Widgster = function (el, options) {

0 commit comments

Comments
 (0)