Skip to content

Commit

Permalink
allow border tabsets to have customizable 'right' buttons (controls)
Browse files Browse the repository at this point in the history
  • Loading branch information
nealus committed Aug 29, 2017
1 parent 1660580 commit b459cfd
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/view/BorderTabSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,30 @@ class BorderTabSet extends React.Component {
}
}

// allow customization of tabset right/bottom buttons
let buttons = [];
let renderState = {buttons: buttons};
this.props.layout.customizeTabSet(this.props.node, renderState);
buttons = renderState.buttons;

//buttons.push(<button
// key="max"
// className={"flexlayout__tab_toolbar_button-min"}></button>);

toolbar = <div
key="toolbar"
ref="toolbar"
className={"flexlayout__border_toolbar_" + border.getLocation().getName()}>
{buttons}
</div>;

return <div
style={style}
className={"flexlayout__border_" + border.getLocation().getName()}>
<div className={"flexlayout__border_inner_" + border.getLocation().getName()}>
{tabs}
</div>
{toolbar}
</div>;
}
}
Expand Down
25 changes: 25 additions & 0 deletions style/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,28 @@
.flexlayout__border_button--selected .flexlayout__border_button_trailing{
background: transparent url("../images/close_white.png") no-repeat center;
}


.flexlayout__border_toolbar_left {
position:absolute;
bottom:0;
right:0;
}

.flexlayout__border_toolbar_right {
position:absolute;
bottom:0;
right:0;
}

.flexlayout__border_toolbar_top {
position:absolute;
top:0;
right:0;
}

.flexlayout__border_toolbar_bottom {
position:absolute;
top:0;
right:0;
}
23 changes: 23 additions & 0 deletions style/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,28 @@
background: transparent url("../images/close.png") no-repeat center;
}

.flexlayout__border_toolbar_left {
position:absolute;
bottom:0;
right:0;
}

.flexlayout__border_toolbar_right {
position:absolute;
bottom:0;
right:0;
}

.flexlayout__border_toolbar_top {
position:absolute;
top:0;
right:0;
}

.flexlayout__border_toolbar_bottom {
position:absolute;
top:0;
right:0;
}


0 comments on commit b459cfd

Please sign in to comment.