Skip to content

Commit

Permalink
Merge pull request #1141 from VirtualFlyBrain/feature/1140
Browse files Browse the repository at this point in the history
Feature/1140 - Layers component hide/show control fix
  • Loading branch information
ddelpiano authored Jun 21, 2021
2 parents 033c654 + 64f7b71 commit c5ee920
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ const buttonBarConfiguration = {
"condition": "(function() { var visible = false; if ($instance$.isVisible != undefined) {visible=$instance$.isVisible(); } return visible; })()",
"false": {
"id": "visibility",
"actions": ["$instance$.show(); setTimeout(() => {if (StackViewer1!=undefined && StackViewer1.updateStackWidget!=undefined) { StackViewer1.updateStackWidget(); }}, 1000)"],
"actions": ["$instance$.show();StackViewer1?.updateStackWidget()"],
"icon": "fa-eye-slash",
"label": "Hidden",
"tooltip": "Show"
},
"true": {
"id": "visibility",
"actions": ["$instance$.hide(); setTimeout(() => {if (StackViewer1!=undefined && StackViewer1.updateStackWidget!=undefined) { StackViewer1.updateStackWidget(); }}, 1000)"],
"actions": ["$instance$.hide(); StackViewer1?.updateStackWidget()"],
"icon": "fa-eye",
"label": "Visible",
"tooltip": "Hide"
Expand Down
6 changes: 6 additions & 0 deletions components/interface/VFBListViewer/ListViewerControlsMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,15 @@ class ListViewerControlsMenu extends Component {
switch (action.handlerAction){
case ACTIONS.SHOW:
this.props.instance.show();
if ( window["StackViewer1"] !== null ) {
window["StackViewer1"]?.updateStackWidget();
}
break;
case ACTIONS.HIDE:
this.props.instance.hide();
if ( window["StackViewer1"] !== null ) {
window["StackViewer1"]?.updateStackWidget();
}
break;
case ACTIONS.SELECT:
this.props.instance.select();
Expand Down

0 comments on commit c5ee920

Please sign in to comment.