mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -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 = {
|
const defaultOptions: ICellRangeSelectorOptions = {
|
||||||
selectionCss: {
|
selectionCss: {
|
||||||
'border': '2px dashed blue'
|
'border': '2px dashed blue'
|
||||||
}
|
},
|
||||||
|
offset: {
|
||||||
|
top: -1,
|
||||||
|
left: -1,
|
||||||
|
height: 2,
|
||||||
|
width: 2
|
||||||
|
},
|
||||||
|
dragClass: 'drag'
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface ICellRangeSelectorOptions {
|
export interface ICellRangeSelectorOptions {
|
||||||
selectionCss?: { [key: string]: string };
|
selectionCss?: { [key: string]: string };
|
||||||
cellDecorator?: ICellRangeDecorator;
|
cellDecorator?: ICellRangeDecorator;
|
||||||
|
offset?: { top: number, left: number, height: number, width: number };
|
||||||
|
dragClass?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ICellRangeSelector<T> extends Slick.Plugin<T> {
|
export interface ICellRangeSelector<T> extends Slick.Plugin<T> {
|
||||||
@@ -78,6 +87,8 @@ export class CellRangeSelector<T> implements ICellRangeSelector<T> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.canvas.classList.add(this.options.dragClass);
|
||||||
|
|
||||||
this.grid.focus();
|
this.grid.focus();
|
||||||
|
|
||||||
let start = this.grid.getCellFromPoint(
|
let start = this.grid.getCellFromPoint(
|
||||||
@@ -114,6 +125,7 @@ export class CellRangeSelector<T> implements ICellRangeSelector<T> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.canvas.classList.remove(this.options.dragClass);
|
||||||
this.dragging = false;
|
this.dragging = false;
|
||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
|
|
||||||
|
|||||||
@@ -308,10 +308,15 @@ export class Table<T extends Slick.SlickData> extends Widget implements IThemabl
|
|||||||
|
|
||||||
if (styles.listHoverBackground) {
|
if (styles.listHoverBackground) {
|
||||||
content.push(`.monaco-table.${this.idPrefix} .slick-row:hover { background-color: ${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) {
|
if (styles.listHoverForeground) {
|
||||||
content.push(`.monaco-table.${this.idPrefix} .slick-row:hover { color: ${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) {
|
if (styles.listSelectionOutline) {
|
||||||
|
|||||||
Reference in New Issue
Block a user