Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Removes unneeded SVG DOM elements for source tree arrows. #4283

Merged
merged 1 commit into from
Oct 5, 2017
Merged
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
5 changes: 5 additions & 0 deletions src/components/PrimaryPanes/Sources.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
display: inline-block;
}

.sources-list .tree .node .no-arrow {
width: 10px;
display: inline-block;
}

.no-sources-message {
font-size: 12px;
color: var(--theme-comment-alt);
Expand Down
7 changes: 4 additions & 3 deletions src/components/PrimaryPanes/SourcesTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,18 +208,19 @@ class SourcesTree extends Component {
}

renderItem(item, depth, focused, _, expanded, { setExpanded }) {
const arrow = (
const arrow = nodeHasChildren(item) ? (
<Svg
name="arrow"
className={classnames({
expanded: expanded,
hidden: !nodeHasChildren(item)
expanded: expanded
})}
onClick={e => {
e.stopPropagation();
setExpanded(item, !expanded);
}}
/>
) : (
<i className="no-arrow" />
);

const icon = this.getIcon(item, depth);
Expand Down