Files: 3d3edbbfdd8ca30c4cc7695192b3883fb399ab26 / app / sync / initialise / userActionListeners.js
763 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 | |
13 | exports.create = function (api) { |
14 | return nest('app.sync.initialise', userActionListeners) |
15 | |
16 | function userActionListeners (App) { |
17 | const tabs = api.app.html.tabs() |
18 | |
19 | api.app.sync.catchKeyboardShortcut(window) |
20 | api.app.async.catchLinkClick(App) |
21 | |
22 | electron.ipcRenderer.on('nextTab', () => { |
23 | tabs.nextTab() |
24 | }) |
25 | |
26 | electron.ipcRenderer.on('previousTab', () => { |
27 | tabs.previousTab() |
28 | }) |
29 | |
30 | electron.ipcRenderer.on('closeTab', () => { |
31 | tabs.closeCurrentTab() |
32 | }) |
33 | |
34 | } |
35 | } |
36 | |
37 |
Built with git-ssb-web