git ssb

16+

Dominic / patchbay



Commit 6d6b963616a8d1fce83d115235fdf87a5b2646bc

Make shortcut close work

Anders Rune Jensen committed on 8/11/2018, 10:46:48 PM
Parent: 865925efc42492b540508c1b16a6df80186a3fc6

Files changed

app/html/tabs.jschanged
app/sync/catch-keyboard-shortcut.jschanged
app/html/tabs.jsView
@@ -58,9 +58,9 @@
5858 return currentPage && currentPage.firstChild
5959 }
6060 _tabs.nextTab = () => _tabs.currentPage() && _tabs.selectRelative(1)
6161 _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) }
6363
6464 // # TODO: review - this works but is strange
6565 initialTabs.forEach(p => api.app.sync.goTo(p))
6666 if (initialTabs[0]) api.app.sync.goTo(initialTabs[0])
app/sync/catch-keyboard-shortcut.jsView
@@ -78,13 +78,10 @@
7878 return goTo(JSON.parse(tabs.currentPage().id))
7979 case 76: // l = right
8080 tabs.selectRelative(1)
8181 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()
8784 return
8885
8986 // Search
9087 case 191: // / = routes search

Built with git-ssb-web