Skip to content

Commit

Permalink
Set term info to focused term when reopening #344
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmartin committed Dec 8, 2022
1 parent e7b3a25 commit bb9b6a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 0 additions & 1 deletion components/VFBMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ class VFBMain extends React.Component {
switch (buttonState) {
case 'termInfoVisible':
this.UIUpdateItem(buttonState, "termInfo");
break;
case 'canvasVisible':
this.UIUpdateItem(buttonState, "canvas");
break;
Expand Down
12 changes: 11 additions & 1 deletion components/interface/VFBTermInfo/VFBTermInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,17 @@ class VFBTermInfoWidget extends React.Component {
componentDidMount () {
window.addEventListener("resize", this.updateDimensions);
if ((this.props.termInfoName !== undefined) && (this.props.termInfoId !== undefined)) {
this.setTermInfo(this.props.termInfoName, this.props.termInfoId);
// Whatever the instance is, extract the meta component
let instance = this.props.termInfoName;
if (instance.getId().indexOf("_meta") === -1 && instance.getParent() !== null) {
instance = instance.getParent();

let meta = instance[instance.getId() + '_meta'];
if ( meta ){
instance = meta;
}
}
this.setTermInfo(instance, this.props.termInfoId);
}
}

Expand Down

0 comments on commit bb9b6a7

Please sign in to comment.