Factorisation de l'ouverture/fermeture d'une colonne

This commit is contained in:
Benjamin Gaudé 2020-06-16 11:31:11 +02:00
parent e3459d136e
commit fbad143bed
1 changed files with 6 additions and 2 deletions

View File

@ -199,7 +199,7 @@ export class BoardPage extends React.Component<BoardPageProps> {
{lane.title} {lane.title}
</h3> </h3>
<button className="button is-light level-item is-small expand" <button className="button is-light level-item is-small expand"
onClick={(e) => { console.log(e.currentTarget.parentNode.parentNode.parentNode.parentNode.parentNode.classList.toggle('minimized'))}}> onClick={this.onMinimizeColumn}>
<span className="icon"> <span className="icon">
<i className="fas fa-chevron-right" aria-hidden="true"></i> <i className="fas fa-chevron-right" aria-hidden="true"></i>
</span> </span>
@ -213,7 +213,7 @@ export class BoardPage extends React.Component<BoardPageProps> {
</span> </span>
</button> </button>
<button className="button is-light level-item is-small" <button className="button is-light level-item is-small"
onClick={(e) => { console.log(e.currentTarget.parentNode.parentNode.parentNode.parentNode.parentNode.classList.toggle('minimized'))}}> onClick={this.onMinimizeColumn}>
<span className="icon"> <span className="icon">
<i className="fas fa-chevron-left" aria-hidden="true"></i> <i className="fas fa-chevron-left" aria-hidden="true"></i>
</span> </span>
@ -224,6 +224,10 @@ export class BoardPage extends React.Component<BoardPageProps> {
) )
} }
onMinimizeColumn(e: any) {
e.currentTarget.closest('.react-kanban-column').classList.toggle('minimized');
}
onCardDragEnd(b: any, card: any, source: any, dest: any) { onCardDragEnd(b: any, card: any, source: any, dest: any) {
const { board } = this.props; const { board } = this.props;
this.props.dispatch(moveCard( this.props.dispatch(moveCard(