git ssb

16+

Dominic / patchbay



Commit d928b22155525d8610fb58f2f596dfec784b2ce6

show the current location when switching tabs

Dominic Tarr committed on 7/6/2016, 10:03:08 AM
Parent: 32011eddea31a79f8eee8156ba03dd32623a2578

Files changed

modules/tabs.jschanged
modules/tabs.jsView
@@ -31,12 +31,15 @@
3131
3232 exports.message_render = []
3333
3434 exports.app = function () {
35- var tabs = Tabs()
35+ var search
36+ var tabs = Tabs(function (name) {
37+ search.value = name
38+ })
3639 tabs.classList.add('screen')
3740
38- var search = search_box(function (path, change) {
41+ search = search_box(function (path, change) {
3942 if(tabs.has(path)) {
4043 tabs.select(path)
4144 return true
4245 }
@@ -47,8 +50,9 @@
4750 localStorage.openTabs = JSON.stringify(tabs.tabs)
4851 return change
4952 }
5053 })
54+
5155 tabs.insertBefore(search, tabs.querySelector('.hypertabs__content'))
5256
5357 var saved = []
5458 try { saved = JSON.parse(localStorage.openTabs) }
@@ -70,10 +74,10 @@
7074 var link = ancestor(ev.target)
7175 if(!link) return
7276 var path = link.hash.substring(1)
7377
78+ ev.stopPropagation()
7479 ev.preventDefault()
75- ev.stopPropagation()
7680
7781 //open external links.
7882 //this ought to be made into something more runcible
7983 if(/^https?/.test(link.href)) return openExternal(link.href)
@@ -159,9 +163,4 @@
159163 return tabs
160164 }
161165
162166
163-
164-
165-
166-
167-

Built with git-ssb-web