sencha / electron-demo

Ext JS / Electron Helpers and Example App
23 stars 13 forks source link

ext-electron package shouldn't break applications while running in a browser #13

Open savelee opened 8 years ago

savelee commented 8 years ago

When requiring/mixin ext-electron packages within a current Ext JS application, it shouldn't break when running in a browser. Instead it should check if running in electron, before loading native stuff.

I solved it by adding to Manager.js, Dialog.js, FilePicker.js, FolderField.js the following check:

  if(window && window.process) {
   // current electron implementation
  } else {
     Ext.define('Ext.electron.Dialog',  {});
 }