mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
add a applystyle function with saftey checks in header filter (#5380)
This commit is contained in:
@@ -28,6 +28,7 @@ export class HeaderFilter {
|
|||||||
private cancelButton: Button;
|
private cancelButton: Button;
|
||||||
private workingFilters: any;
|
private workingFilters: any;
|
||||||
private columnDef: any;
|
private columnDef: any;
|
||||||
|
private buttonStyles: IButtonStyles;
|
||||||
|
|
||||||
constructor(options: any) {
|
constructor(options: any) {
|
||||||
this.options = mixin(options, this.defaults, false);
|
this.options = mixin(options, this.defaults, false);
|
||||||
@@ -220,6 +221,8 @@ export class HeaderFilter {
|
|||||||
const cancelElement = jQuery('#filter-cancel-button');
|
const cancelElement = jQuery('#filter-cancel-button');
|
||||||
cancelElement.bind('click', () => this.hideMenu());
|
cancelElement.bind('click', () => this.hideMenu());
|
||||||
|
|
||||||
|
this.applyStyles();
|
||||||
|
|
||||||
jQuery(':checkbox', $filter).bind('click', (e) => {
|
jQuery(':checkbox', $filter).bind('click', (e) => {
|
||||||
this.workingFilters = this.changeWorkingFilter(filterItems, this.workingFilters, jQuery(e.target));
|
this.workingFilters = this.changeWorkingFilter(filterItems, this.workingFilters, jQuery(e.target));
|
||||||
});
|
});
|
||||||
@@ -237,9 +240,25 @@ export class HeaderFilter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public style(styles: IButtonStyles): void {
|
public style(styles: IButtonStyles): void {
|
||||||
this.okButton.style(styles);
|
this.buttonStyles = styles;
|
||||||
this.clearButton.style(styles);
|
this.applyStyles();
|
||||||
this.cancelButton.style(styles);
|
}
|
||||||
|
|
||||||
|
private applyStyles() {
|
||||||
|
if (this.buttonStyles) {
|
||||||
|
const styles = this.buttonStyles;
|
||||||
|
if (this.okButton) {
|
||||||
|
this.okButton.style(styles);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.clearButton) {
|
||||||
|
this.clearButton.style(styles);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.cancelButton) {
|
||||||
|
this.cancelButton.style(styles);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private columnsResized() {
|
private columnsResized() {
|
||||||
|
|||||||
Reference in New Issue
Block a user