Files: c1a1dc7a8dc3f88bd242e418cb5715798385f4e4 / app / sync / initialise / userActionListeners.js
759 bytesRaw
1 | const nest = require('depnest') |
2 | const electron = require('electron') |
3 | |
4 | exports.gives = nest('app.sync.initialise') |
5 | |
6 | exports.needs = nest({ |
7 | 'app.async.catchLinkClick': 'first', |
8 | 'app.sync.catchKeyboardShortcut': 'first', |
9 | 'app.html.tabs': 'first' |
10 | }) |
11 | |
12 | exports.create = function (api) { |
13 | return nest('app.sync.initialise', userActionListeners) |
14 | |
15 | function userActionListeners (App) { |
16 | const tabs = api.app.html.tabs() |
17 | |
18 | api.app.sync.catchKeyboardShortcut(window) |
19 | api.app.async.catchLinkClick(App) |
20 | |
21 | electron.ipcRenderer.on('nextTab', () => { |
22 | tabs.nextTab() |
23 | }) |
24 | |
25 | electron.ipcRenderer.on('previousTab', () => { |
26 | tabs.previousTab() |
27 | }) |
28 | |
29 | electron.ipcRenderer.on('closeTab', () => { |
30 | tabs.closeCurrentTab() |
31 | }) |
32 | } |
33 | } |
34 |
Built with git-ssb-web