mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 01:25:38 -05:00
Add fix for flashing during dragging and resize drag box (#2451)
* add fix for flashing during dragging and resize drag box * remove unnecessary code
This commit is contained in:
@@ -5,12 +5,21 @@ require.__$__nodeRequire('slickgrid/plugins/slick.cellrangedecorator');
|
||||
const defaultOptions: ICellRangeSelectorOptions = {
|
||||
selectionCss: {
|
||||
'border': '2px dashed blue'
|
||||
}
|
||||
},
|
||||
offset: {
|
||||
top: -1,
|
||||
left: -1,
|
||||
height: 2,
|
||||
width: 2
|
||||
},
|
||||
dragClass: 'drag'
|
||||
};
|
||||
|
||||
export interface ICellRangeSelectorOptions {
|
||||
selectionCss?: { [key: string]: string };
|
||||
cellDecorator?: ICellRangeDecorator;
|
||||
offset?: { top: number, left: number, height: number, width: number };
|
||||
dragClass?: string;
|
||||
}
|
||||
|
||||
export interface ICellRangeSelector<T> extends Slick.Plugin<T> {
|
||||
@@ -78,6 +87,8 @@ export class CellRangeSelector<T> implements ICellRangeSelector<T> {
|
||||
return;
|
||||
}
|
||||
|
||||
this.canvas.classList.add(this.options.dragClass);
|
||||
|
||||
this.grid.focus();
|
||||
|
||||
let start = this.grid.getCellFromPoint(
|
||||
@@ -114,6 +125,7 @@ export class CellRangeSelector<T> implements ICellRangeSelector<T> {
|
||||
return;
|
||||
}
|
||||
|
||||
this.canvas.classList.remove(this.options.dragClass);
|
||||
this.dragging = false;
|
||||
e.stopImmediatePropagation();
|
||||
|
||||
|
||||
@@ -308,10 +308,15 @@ export class Table<T extends Slick.SlickData> extends Widget implements IThemabl
|
||||
|
||||
if (styles.listHoverBackground) {
|
||||
content.push(`.monaco-table.${this.idPrefix} .slick-row:hover { background-color: ${styles.listHoverBackground}; }`);
|
||||
// handle no coloring during drag
|
||||
content.push(`.monaco-table.${this.idPrefix} .drag .slick-row:hover { background-color: inherit; }`);
|
||||
|
||||
}
|
||||
|
||||
if (styles.listHoverForeground) {
|
||||
content.push(`.monaco-table.${this.idPrefix} .slick-row:hover { color: ${styles.listHoverForeground}; }`);
|
||||
// handle no coloring during drag
|
||||
content.push(`.monaco-table.${this.idPrefix} .drag .slick-row:hover { color: inherit; }`);
|
||||
}
|
||||
|
||||
if (styles.listSelectionOutline) {
|
||||
|
||||
Reference in New Issue
Block a user