Skip to content

Commit

Permalink
Fix KuiPopover examples. (#13460)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal authored Aug 10, 2017
1 parent a77e6f8 commit afe76f1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
35 changes: 24 additions & 11 deletions ui_framework/doc_site/src/views/popover/popover_anchor_position.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,32 @@ export default class extends Component {
super(props);

this.state = {
isPopoverOpen: false,
isPopoverOpen1: false,
isPopoverOpen2: false,
};
}

onButtonClick() {
onButtonClick1() {
this.setState({
isPopoverOpen: !this.state.isPopoverOpen,
isPopoverOpen1: !this.state.isPopoverOpen1,
});
}

closePopover() {
closePopover1() {
this.setState({
isPopoverOpen: false,
isPopoverOpen1: false,
});
}

onButtonClick2() {
this.setState({
isPopoverOpen2: !this.state.isPopoverOpen2,
});
}

closePopover2() {
this.setState({
isPopoverOpen2: false,
});
}

Expand All @@ -32,13 +45,13 @@ export default class extends Component {
<div>
<KuiPopover
button={(
<button onClick={this.onButtonClick.bind(this)}>
<button onClick={this.onButtonClick1.bind(this)}>
Popover anchored to the right.
</button>
)}
isOpen={this.state.isPopoverOpen}
isOpen={this.state.isPopoverOpen1}
closePopover={this.closePopover1.bind(this)}
anchorPosition="right"
closePopover={() => {}}
>
Popover content
</KuiPopover>
Expand All @@ -47,13 +60,13 @@ export default class extends Component {

<KuiPopover
button={(
<button onClick={this.onButtonClick.bind(this)}>
<button onClick={this.onButtonClick2.bind(this)}>
Popover anchored to the left.
</button>
)}
isOpen={this.state.isPopoverOpen}
isOpen={this.state.isPopoverOpen2}
closePopover={this.closePopover2.bind(this)}
anchorPosition="left"
closePopover={() => {}}
>
Popover content
</KuiPopover>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export default class extends Component {
</button>
)}
isOpen={this.state.isPopoverOpen}
closePopover={this.closePopover.bind(this)}
bodyClassName="yourClassNameHere"
closePopover={() => {}}
>
It's hard to tell but there's a custom class on this element
</KuiPopover>
Expand Down

0 comments on commit afe76f1

Please sign in to comment.