Commit 6d6b963616a8d1fce83d115235fdf87a5b2646bc
Make shortcut close work
Anders Rune Jensen committed on 8/11/2018, 10:46:48 PMParent: 865925efc42492b540508c1b16a6df80186a3fc6
Files changed
app/html/tabs.js | changed |
app/sync/catch-keyboard-shortcut.js | changed |
app/html/tabs.js | ||
---|---|---|
@@ -58,9 +58,9 @@ | ||
58 | 58 … | return currentPage && currentPage.firstChild |
59 | 59 … | } |
60 | 60 … | _tabs.nextTab = () => _tabs.currentPage() && _tabs.selectRelative(1) |
61 | 61 … | _tabs.previousTab = () => _tabs.currentPage() && _tabs.selectRelative(-1) |
62 | - _tabs.closeCurrentTab = () => _tabs.currentPage() && _tabs.remove(_tabs.selected[0]) | |
62 … | + _tabs.closeCurrentTab = () => { _tabs.currentPage() && _tabs.remove(_tabs.selected[0]); _tabs.select(-1) } | |
63 | 63 … | |
64 | 64 … | // # TODO: review - this works but is strange |
65 | 65 … | initialTabs.forEach(p => api.app.sync.goTo(p)) |
66 | 66 … | if (initialTabs[0]) api.app.sync.goTo(initialTabs[0]) |
app/sync/catch-keyboard-shortcut.js | ||
---|---|---|
@@ -78,13 +78,10 @@ | ||
78 | 78 … | return goTo(JSON.parse(tabs.currentPage().id)) |
79 | 79 … | case 76: // l = right |
80 | 80 … | tabs.selectRelative(1) |
81 | 81 … | return goTo(JSON.parse(tabs.currentPage().id)) |
82 | - case 88: // x = close | |
83 | - if (tabs.selected) { | |
84 | - var sel = tabs.selected | |
85 | - tabs.remove(sel) | |
86 | - } | |
82 … | + case 88: // x = close | |
83 … | + tabs.closeCurrentTab() | |
87 | 84 … | return |
88 | 85 … | |
89 | 86 … | // Search |
90 | 87 … | case 191: // / = routes search |
Built with git-ssb-web