Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for sensitive dropdown menu closing too easy #545

Merged
merged 1 commit into from
May 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/browser/modules/Stream/FrameTitlebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { FrameButton } from 'browser-components/buttons'
import Visible from 'browser-components/Visible'
import { CSVSerializer } from 'services/serializer'
import { ExpandIcon, ContractIcon, RefreshIcon, CloseIcon, UpIcon, DownIcon, PinIcon, DownloadIcon } from 'browser-components/icons/Icons'
import { StyledFrameTitleBar, StyledFrameCommand, DottedLineHover, FrameTitlebarButtonSection, DropdownContent, DropdownButton, DropdownItem } from './styled'
import { StyledFrameTitleBar, StyledFrameCommand, DottedLineHover, FrameTitlebarButtonSection, DropdownList, DropdownContent, DropdownButton, DropdownItem } from './styled'
import { downloadPNGFromSVG } from 'shared/services/exporting/pngUtils'

const getCsvData = (exportData) => {
Expand Down Expand Up @@ -81,10 +81,12 @@ class FrameTitlebar extends Component {
<Visible if={frame.type === 'cypher' && props.exportData}>
<DropdownButton>
<DownloadIcon />
<DropdownContent class='dropdown-content'>
<DropdownItem onClick={() => this.exportPNG()}>Export PNG</DropdownItem>
<DropdownItem download='export.csv' href={this.state.csvData}>Export CSV</DropdownItem>
</DropdownContent>
<DropdownList>
<DropdownContent>
<DropdownItem onClick={() => this.exportPNG()}>Export PNG</DropdownItem>
<DropdownItem download='export.csv' href={this.state.csvData}>Export CSV</DropdownItem>
</DropdownContent>
</DropdownList>
</DropdownButton>
</Visible>
<FrameButton title='Pin at top' onClick={() => {
Expand Down
6 changes: 5 additions & 1 deletion src/browser/modules/Stream/styled.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,16 @@ export const DropdownButton = styled.li`
}
display: inline-block;
&:hover {
> .dropdown-content {
> ul li {
display: block;
}
};
`

export const DropdownList = styled.ul`

`

export const DropdownContent = styled.li`
display: none;
position: absolute;
Expand Down