Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Commit

Permalink
Do not use arrow functions in demos
Browse files Browse the repository at this point in the history
See discussion in #79
for more context.
  • Loading branch information
haacked committed Sep 27, 2016
1 parent 0f7be50 commit efa3d1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion renderer-process/windows/manage-window.js
Expand Up @@ -9,7 +9,7 @@ manageWindowBtn.addEventListener('click', function (event) {
win = new BrowserWindow({ width: 400, height: 275 })
win.on('resize', updateReply)
win.on('move', updateReply)
win.on('close', () => { win = null })
win.on('close', function() { win = null })
win.loadURL(modalPath)
win.show()
function updateReply () {
Expand Down
6 changes: 3 additions & 3 deletions renderer-process/windows/using-window-events.js
Expand Up @@ -5,12 +5,12 @@ const manageWindowBtn = document.getElementById('listen-to-window')
const focusModalBtn = document.getElementById('focus-on-modal-window')
let win

manageWindowBtn.addEventListener('click', () => {
manageWindowBtn.addEventListener('click', function() {
const modalPath = path.join('file://', __dirname, '../../sections/windows/modal-toggle-visibility.html')
win = new BrowserWindow({ width: 600, height: 400 })
win.on('focus', hideFocusBtn)
win.on('blur', showFocusBtn)
win.on('close', () => {
win.on('close', function() {
hideFocusBtn()
win = null
})
Expand All @@ -20,7 +20,7 @@ manageWindowBtn.addEventListener('click', () => {
if (!win) return
focusModalBtn.classList.add('smooth-appear')
focusModalBtn.classList.remove('disappear')
focusModalBtn.addEventListener('click', () => win.focus())
focusModalBtn.addEventListener('click', function() { win.focus() })
}
function hideFocusBtn () {
focusModalBtn.classList.add('disappear')
Expand Down

0 comments on commit efa3d1b

Please sign in to comment.