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

It's wrong #146

Closed Suremotoo closed 6 years ago

Suremotoo commented 6 years ago

position: js/menu.js

// Add the listener
document.addEventListener('DOMContentLoaded', function () {
  document.querySelector('.js-context-menu').addEventListener('click', function (event) {
    menu.popup(remote.getCurrentWindow());
  })
})

TypeError: Cannot read property 'addEventListener' of null

mrdotkg commented 6 years ago

Could you please explain what is the issue and steps to reproduce?

Suremotoo commented 6 years ago

My steps: 1、git clone repo 2、cd repo && npm intsall 3、start

The project is working, but browser console show error

TypeError: Cannot read property 'addEventListener' of null

i fixed, .js-context-menu it not found, remove it ,it's ok!