Browse Source

Merge pull request #259 from codepiano/master

change the way to judge whether in electron
Dante 9 years ago
parent
commit
b7e8f05a77
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/js/bootstrap-dialog.js

+ 1 - 1
src/js/bootstrap-dialog.js

@@ -17,7 +17,7 @@
 
 
     // CommonJS module is defined
     // CommonJS module is defined
     if (typeof module !== 'undefined' && module.exports) {
     if (typeof module !== 'undefined' && module.exports) {
-        var isNode = (typeof process !== "undefined");
+        var isNode = (typeof process === "object") && (typeof process.versions === "object");
         var isElectron = isNode && ('electron' in process.versions);
         var isElectron = isNode && ('electron' in process.versions);
         if (isElectron) {
         if (isElectron) {
             root.BootstrapDialog = factory(root.jQuery);
             root.BootstrapDialog = factory(root.jQuery);