"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "app/src/ui/lib/list/list.tsx" between
desktop-release-2.7.2-linux1.tar.gz and desktop-release-2.8.0-linux1.tar.gz

About: GitHub Desktop (Linux) is an open source Electron-based GitHub app. It is written in TypeScript and uses React. A fork of GitHub Desktop to support various Linux distributions. Release candidate.

list.tsx  (desktop-release-2.7.2-linux1):list.tsx  (desktop-release-2.8.0-linux1)
skipping to change at line 1070 skipping to change at line 1070
} else { } else {
newSelection = [...this.props.selectedRows, row] newSelection = [...this.props.selectedRows, row]
} }
this.props.onSelectionChanged(newSelection, { this.props.onSelectionChanged(newSelection, {
kind: 'mouseclick', kind: 'mouseclick',
event, event,
}) })
} }
} else if ( } else if (
this.props.selectionMode === 'range' && (this.props.selectionMode === 'range' ||
this.props.selectionMode === 'multi') &&
this.props.selectedRows.length > 1 && this.props.selectedRows.length > 1 &&
this.props.selectedRows.includes(row) this.props.selectedRows.includes(row)
) { ) {
// Do nothing. Multiple rows are already selected for a range. We assume // Do nothing. Multiple rows are already selected. We assume the user is
// the user is pressing down on multiple and may desire to start // pressing down on multiple and may desire to start dragging. We will
// dragging. We will invoke the single selection `onRowMouseUp` if they // invoke the single selection `onRowMouseUp` if they let go here and no
// let go here and no special keys are being pressed. // special keys are being pressed.
} else if ( } else if (
this.props.selectedRows.length !== 1 || this.props.selectedRows.length !== 1 ||
(this.props.selectedRows.length === 1 && (this.props.selectedRows.length === 1 &&
row !== this.props.selectedRows[0]) row !== this.props.selectedRows[0])
) { ) {
/* /*
* if no special key is pressed, and that the selection is different, * if no special key is pressed, and that the selection is different,
* single selection occurs * single selection occurs
*/ */
this.selectSingleRowAfterMouseEvent(row, event) this.selectSingleRowAfterMouseEvent(row, event)
skipping to change at line 1114 skipping to change at line 1115
return return
} }
const multiSelectKey = __DARWIN__ ? event.metaKey : event.ctrlKey const multiSelectKey = __DARWIN__ ? event.metaKey : event.ctrlKey
if ( if (
!event.shiftKey && !event.shiftKey &&
!multiSelectKey && !multiSelectKey &&
this.props.selectedRows.length > 1 && this.props.selectedRows.length > 1 &&
this.props.selectedRows.includes(row) && this.props.selectedRows.includes(row) &&
this.props.selectionMode === 'range' (this.props.selectionMode === 'range' ||
this.props.selectionMode === 'multi')
) { ) {
// No special keys are depressed and multiple rows were selected in a // No special keys are depressed and multiple rows were selected. The
// range. The onRowMouseDown event was ignored for this scenario because // onRowMouseDown event was ignored for this scenario because the user may
// the user may desire to started dragging multiple. However, if they let // desire to started dragging multiple. However, if they let go, we want a
// go, we want a new single selection to occur. // new single selection to occur.
this.selectSingleRowAfterMouseEvent(row, event) this.selectSingleRowAfterMouseEvent(row, event)
} }
} }
private selectSingleRowAfterMouseEvent( private selectSingleRowAfterMouseEvent(
row: number, row: number,
event: React.MouseEvent<any> event: React.MouseEvent<any>
): void { ): void {
if (this.props.onSelectionChanged) { if (this.props.onSelectionChanged) {
this.props.onSelectionChanged([row], { kind: 'mouseclick', event }) this.props.onSelectionChanged([row], { kind: 'mouseclick', event })
 End of changes. 4 change blocks. 
10 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)