Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navbar fixes #20

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/explorer-views/src/components/rdf-term.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ function renderCompactedIRI(iri: IRIOrBlankNode, context: RenderContext, options
{options.linkContents || <>
{prefixedName.prefixLabel.length ? <span class="rdf-iri-prefixlabel">{prefixedName.prefixLabel}</span> : null}
<span class="rdf-iri-colon">:</span>
{prefixedName.localName.length ? <span class="rdf-iri-localname">{Ix.from<HtmlContent>(prefixedName.localName.split(/(?<=[^A-Z])(?=[A-Z])/)).intersperse(<wbr />)}</span> : null}
{prefixedName.localName.length ? <span class="rdf-iri-localname">{Ix.from<HtmlContent>(prefixedName.localName.split(/(?<=[^A-Z])(?=[A-Z])/)).intersperse(<> </>)}</span> : null}
</>}
</a>;
}
Expand Down
4 changes: 4 additions & 0 deletions packages/explorer-views/src/components/tabview.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
text-decoration: underline;
}

.tabview .tabview-tabs label:last-of-type {
margin-right: 0;
}

.tabview .tabview-pages > * {
display: none;
margin: 0;
Expand Down
2 changes: 2 additions & 0 deletions packages/explorer-views/src/components/treeview.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,6 @@

.tree a {
display: inline-block;
white-space: nowrap;
margin-right: .5em;
}
2 changes: 1 addition & 1 deletion packages/explorer-views/src/pages/navigation.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ nav {
background: var(--base01);
border: 1px solid var(--base02);
padding: 1.5rem .5rem 5rem;
overflow: clip auto;
overflow: auto;
overscroll-behavior: none;
}

Expand Down
20 changes: 12 additions & 8 deletions packages/explorer/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,20 @@ else {
dialog.showModal();

function setLayoutsSize(clientX: number) { // eslint-disable-line no-inner-declarations
const width = Math.min(Math.max(clientX - 4, window.innerWidth * 0.15), window.innerWidth * 0.85) + "px";
const minWidth = 359; // to accommodate at least the main 4 tabs (Classes, Properties, Ontologies and Files)

navigationDivider.style.left = width;
navigationPane.style.width = width;
mainContent.style.marginLeft = width;
let width = Math.min(Math.max(clientX - 4, window.innerWidth * 0.15), window.innerWidth * 0.85);

if (width < minWidth) {
width = minWidth;
}

navigationDivider.style.left = width + "px";
navigationPane.style.width = width + "px";
mainContent.style.marginLeft = width + "px";

if (window.localStorage) {
window.localStorage.setItem(navWidthStorageKey, width);
window.localStorage.setItem(navWidthStorageKey, width + "px");
}
}

Expand Down Expand Up @@ -269,9 +275,7 @@ else {

if (window.localStorage) {
const navWidth = Number.parseInt(window.localStorage.getItem(navWidthStorageKey) || "");
if (!Number.isNaN(navWidth)) {
setLayoutsSize(navWidth);
}
setLayoutsSize(navWidth || 0);
}

progress.className = "progress-bar loading";
Expand Down
Loading