Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
Show Window Name missing in Action Menu #1009
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunkat committed Jul 18, 2017
1 parent c3cfde9 commit 78dece8
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions src/components/header/SubHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,19 @@ class Subheader extends Component {
super(props);

this.state = {
pdfSrc: null
pdfSrc: null,
elementPath: ''
}
}

componentDidMount() {
document.getElementsByClassName('js-subheader-column')[0].focus();

elementPathRequest('window', this.props.windowType).then(response => {
this.setState({
elementPath: response.data
});
});
}

handleKeyDown = (e) => {
Expand Down Expand Up @@ -121,6 +128,10 @@ class Subheader extends Component {
handleEditModeToggle, handleEmail
} = this.props;

const {
elementPath
} = this.state;

const docLinks = dataId && [
<div
key={0}
Expand Down Expand Up @@ -177,9 +188,8 @@ class Subheader extends Component {
</div>
]

const currentNode = breadcrumb &&
breadcrumb[breadcrumb.length - 1] &&
breadcrumb[breadcrumb.length - 1].children;
const currentNode = elementPath &&
elementPath.children[elementPath.children.length-1];

return (
<div
Expand All @@ -195,8 +205,12 @@ class Subheader extends Component {
transparentBookmarks={!!siteName}
updateData={this.handleUpdateBreadcrumb}
>
<span className="subheader-title">
{currentNode ? currentNode.caption : siteName}
<span
title={
currentNode ? currentNode.caption : siteName
}
className="subheader-title">
{currentNode ? currentNode.caption : siteName}
</span>
</BookmarkButton>
</div>
Expand Down

0 comments on commit 78dece8

Please sign in to comment.