Files: 6791a012f6f25d8aeb64cae36c5f8ff3b21e9132 / app / sync / initialise / user-action-listeners.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