connors / photon

The fastest way to build beautiful Electron apps using simple HTML and CSS
photonkit.com
MIT License
10.01k stars 579 forks source link

Error in menu.js #90

Open bibhas2 opened 8 years ago

bibhas2 commented 8 years ago

When I use the /template-app/index.html from the Electron's electron-quick-start app, I get this error upon startup:

menu.js:24 Uncaught TypeError: Cannot read property 'addEventListener' of null

The relevant portion in js/menu.js should be modified to this:

// Add the listener
document.addEventListener('DOMContentLoaded', function () {
  document.addEventListener('contextmenu', function (event) {
    menu.popup(remote.getCurrentWindow());
  })
})

Now the context menu opens fine.

Please let me know if you will like me to do a PR. Thanks.

connors commented 8 years ago

Is there a reason not to use Photon's provided quick start app from app.js? I feel like there will always be some conflicts there.

bibhas2 commented 8 years ago

Hi, not sure about what you mean by "Photon's provided quick start app". I am using the template-app that comes with the Photon distribution. The menu.js file there has this defect.

AlhasanIQ commented 8 years ago

same here , in menu.js line 24 . looked for the .js-context-menu manually and couldn't find it

ungoldman commented 8 years ago

I believe this issue is a duplicate of #49

wkoszek commented 8 years ago

@connors I'm seeing the same issue. Tried latest electron (pre-built binary).

willkriski commented 6 years ago

Same here over a year later, it's referencing .js-context-menu nowhere to be found in quick start app :)

ungoldman commented 6 years ago

@willkriski I think this project is no longer being maintained. Use at your own risk 😢