Skip to content

Commit 5dde28c

Browse files
author
Tim Berners-Lee
committed
hand merge from select-tabs branch and bump version to match that - people published from dev not master
1 parent c3eb166 commit 5dde28c

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "solid-ui",
3-
"version": "0.12.5",
3+
"version": "0.12.6",
44
"description": "UI library for writing Solid read-write-web applications",
55
"main": "./lib/index.js",
66
"files": [

src/style.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = {
99
buttonStyle: 'background-color: #fff; padding: 0.5em; border: .01em solid white; font-size: 100%;', // 'background-color: #eef;
1010
// The width of the text field must bot be 100% or it switches to overlapping
1111
messageBodyStyle: 'white-space: pre-wrap; width: 99%; font-size:100%; border: 0.07em solid #eee; padding: .3em 0.5em; margin: 0.1em;',
12-
pendingeditModifier: 'color: #bbb;'
12+
pendingeditModifier: 'color: #bbb;',
13+
highlightColor: '#7C4DFF' // Solid lavendar https://design.inrupt.com/atomic-core/?cat=Core
1314

1415
}

src/tabs.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,21 @@ UI.tabs.tabWidget = function (options) {
292292
box.refresh = sync
293293
sync()
294294

295-
if (!options.startEmpty && tabContainer.children.length) {
295+
// From select-tabs branch by hand
296+
if (!options.startEmpty && tabContainer.children.length && options.selectedTab) {
297+
var tab
298+
var found = false
299+
for (var i = 0; i < tabContainer.children.length; i++) {
300+
tab = tabContainer.children[i]
301+
if (tab.firstChild && tab.firstChild.dataset.name === options.selectedTab) {
302+
tab.firstChild.click()
303+
found = true
304+
}
305+
}
306+
if (!found) {
307+
tabContainer.children[0].firstChild.click() // Open first tab
308+
}
309+
} else if (!options.startEmpty && tabContainer.children.length) {
296310
tabContainer.children[0].firstChild.click() // Open first tab
297311
}
298312
return box

0 commit comments

Comments
 (0)