Commit 20e56e6bb267f73d48091b7c9576ae3f9bab0bee
WIP - Rough sketch for adding forward and back button
Chris Adams committed on 5/11/2018, 8:44:09 AMParent: ac4142da16c5834e703d5723d94c3b3035a34ae0
Files changed
main-window.js | changed |
package.json | changed |
main-window.js | ||
---|---|---|
@@ -11,9 +11,11 @@ | ||
11 | 11 … | var LatestUpdate = require('./lib/latest-update') |
12 | 12 … | var ref = require('ssb-ref') |
13 | 13 … | var setupContextMenuAndSpellCheck = require('./lib/context-menu-and-spellcheck') |
14 | 14 … | var watch = require('mutant/watch') |
15 … | +var mousetrap = require("mousetrap") | |
15 | 16 … | |
17 … | + | |
16 | 18 … | module.exports = function (config) { |
17 | 19 … | var sockets = combine( |
18 | 20 … | overrideConfig(config), |
19 | 21 … | addCommand('app.navigate', navigate), |
@@ -72,8 +74,11 @@ | ||
72 | 74 … | watch(pendingCount, count => { |
73 | 75 … | electron.remote.app.setBadgeCount(count) |
74 | 76 … | }) |
75 | 77 … | |
78 … | + | |
79 … | + | |
80 … | + | |
76 | 81 … | document.head.appendChild( |
77 | 82 … | h('style', { |
78 | 83 … | innerHTML: computed(api.settings.obs.get('patchwork.theme', 'light'), themeName => { |
79 | 84 … | return themes[themeName] || themes['light'] |
@@ -147,8 +152,16 @@ | ||
147 | 152 … | api.app.navigate(href) |
148 | 153 … | } |
149 | 154 … | }) |
150 | 155 … | |
156 … | + | |
157 … | + // TODO - should this be in a separate file instead? | |
158 … | + // And should we be using the Electron MenuItem API over mousetrap? | |
159 … | + | |
160 … | + mousetrap.bind(["command+[", "command+left"], views.goBack) | |
161 … | + mousetrap.bind(["command+]", "command+right"], views.goForward) | |
162 … | + | |
163 … | + | |
151 | 164 … | return [container, previewElement] |
152 | 165 … | |
153 | 166 … | // scoped |
154 | 167 … |
Built with git-ssb-web