1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-01-17 18:26:17 +02:00

Sidebar - click on options button shouldn't trigger change board

This commit is contained in:
Chen-I Lim 2020-10-13 14:10:33 -07:00
parent 61a6bac9dc
commit 5e7712d9f2
2 changed files with 8 additions and 3 deletions

View File

@ -25,8 +25,8 @@ class Sidebar extends React.Component<Props> {
boards.map(board => { boards.map(board => {
const displayTitle = board.title || "(Untitled Board)" const displayTitle = board.title || "(Untitled Board)"
return ( return (
<div key={board.id} className="octo-sidebar-item octo-hover-container" onClick={() => { this.boardClicked(board) }}> <div key={board.id} className="octo-sidebar-item octo-hover-container">
<div>{board.icon ? `${board.icon} ${displayTitle}` : displayTitle}</div> <div className="octo-sidebar-title" onClick={() => { this.boardClicked(board) }}>{board.icon ? `${board.icon} ${displayTitle}` : displayTitle}</div>
<div className="octo-spacer"></div> <div className="octo-spacer"></div>
<div className="octo-button square octo-hover-item" onClick={(e) => { this.showOptions(e, board) }}><div className="imageOptions" /></div> <div className="octo-button square octo-hover-item" onClick={(e) => { this.showOptions(e, board) }}><div className="imageOptions" /></div>
</div> </div>
@ -67,6 +67,8 @@ class Sidebar extends React.Component<Props> {
} }
} }
Menu.shared.showAtElement(e.target as HTMLElement) Menu.shared.showAtElement(e.target as HTMLElement)
e.stopPropagation()
} }
private boardClicked(board: Board) { private boardClicked(board: Board) {

View File

@ -102,10 +102,13 @@ hr {
flex-direction: row; flex-direction: row;
font-weight: 500; font-weight: 500;
cursor: pointer;
padding: 3px 20px; padding: 3px 20px;
} }
.octo-sidebar-title {
cursor: pointer;
}
.octo-sidebar-item:hover { .octo-sidebar-item:hover {
background-color: rgba(0, 0, 0, 0.05); background-color: rgba(0, 0, 0, 0.05);
} }