Skip to content

Commit 8ca7656

Browse files
author
Alain Bourgeois
committed
responsive css
1 parent dccf8da commit 8ca7656

2 files changed

Lines changed: 53 additions & 1 deletion

File tree

src/folderPane.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,15 @@ export default {
9696
packageDiv.classList.add('folderPanePackageDiv')
9797
kb.fetcher.load(indexThing.doc()).then(function () {
9898
mainTable = packageDiv.appendChild(dom.createElement('table'))
99+
mainTable.classList.add('folderPaneMainTable')
99100
context
100101
.getOutliner(dom)
101102
.GotoSubject(indexThing, true, undefined, false, undefined, mainTable)
102103
})
103104
return div
104105
} else {
105106
mainTable = div.appendChild(dom.createElement('table'))
107+
mainTable.classList.add('folderPaneMainTable')
106108
mainTable.refresh = refresh
107109
refresh()
108110
// addDownstreamChangeListener is a high level function which when someone else changes the resource,
@@ -112,6 +114,7 @@ export default {
112114

113115
// Allow user to create new things within the folder
114116
const creationDiv = div.appendChild(dom.createElement('div'))
117+
creationDiv.classList.add('folderPaneCreationDiv')
115118
const me = authn.currentUser() // @@ respond to login events
116119
if (!me) {
117120
return div // Cannot create new things without being logged in
@@ -144,6 +147,10 @@ export default {
144147
target = creationDiv.firstChild // Overload drop target semantics onto the plus sign
145148
}
146149

150+
if (target instanceof HTMLElement) {
151+
target.classList.add('folderPaneDropTarget')
152+
}
153+
147154
// /////////// Allow new file to be Uploaded
148155
UI.widgets.makeDropTarget(target, null, droppedFileHandler)
149156
})

src/styles/folderPane.css

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,63 @@
11
.folderPaneInstancePane {
2+
box-sizing: border-box;
3+
width: 100%;
4+
max-width: 100%;
25
border-top: solid 1px #777;
36
border-bottom: solid 1px #777;
47
margin-top: var(--spacing-xs, 0.5em);
58
margin-bottom: var(--spacing-xs, 0.5em);
9+
overflow-x: auto;
10+
-webkit-overflow-scrolling: touch;
611
}
12+
713
.folderPanePackageDiv {
14+
width: 100%;
15+
max-width: 100%;
816
border-top: 0.2em solid #ccc;
17+
overflow-x: auto;
18+
}
19+
20+
.folderPaneMainTable {
21+
width: 100%;
22+
max-width: 100%;
23+
table-layout: auto;
24+
text-align: left;
25+
}
26+
27+
.folderPaneMainTable td,
28+
.folderPaneMainTable th {
29+
text-align: left;
30+
vertical-align: top;
31+
overflow-wrap: anywhere;
32+
word-break: break-word;
933
}
1034

1135
.folderPanePredicateCell {
12-
min-width: 3em;
36+
min-width: 0.1em;
37+
}
38+
39+
.folderPaneCreationDiv {
40+
width: 100%;
41+
max-width: 100%;
42+
}
43+
44+
.folderPaneDropTarget {
45+
max-width: 100%;
1346
}
1447

1548
.folderPaneExplicitDropIcon {
1649
width: var(--icon-base, 2em);
1750
height: var(--icon-base, 2em);
1851
}
52+
53+
@media (max-width: 700px) {
54+
.folderPaneInstancePane {
55+
margin-top: var(--spacing-2xs, 0.25em);
56+
margin-bottom: var(--spacing-2xs, 0.25em);
57+
}
58+
59+
.folderPaneExplicitDropIcon {
60+
width: var(--icon-sm, 1.5em);
61+
height: var(--icon-sm, 1.5em);
62+
}
63+
}

0 commit comments

Comments
 (0)