Browse Source

Merge pull request #7129 from kalutkaz/pieFlotDateFix

[3.4.2] UI: Remove selection (mode:x) for Pie-flot widget
pull/7236/head
Igor Kulikov 4 years ago
committed by GitHub
parent
commit
490b78567b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.ts

18
ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.ts

@ -153,13 +153,13 @@ export class TbFlot {
autoHighlight: this.tooltipIndividual === true,
markings: []
},
selection : { mode : 'x' },
legend : {
show: false
}
};
if (this.chartType === 'line' || this.chartType === 'bar' || this.chartType === 'state') {
this.options.selection = { mode : 'x' };
this.options.xaxes = [];
this.xaxis = {
mode: 'time',
@ -1206,10 +1206,12 @@ export class TbFlot {
private enableMouseEvents() {
this.$element.css('pointer-events', '');
this.$element.addClass('mouse-events');
this.options.selection = { mode : 'x' };
if (this.chartType !== 'pie') {
this.options.selection = {mode: 'x'};
this.$element.bind('plotselected', this.flotSelectHandler);
this.$element.bind('dblclick', this.dblclickHandler);
}
this.$element.bind('plothover', this.flotHoverHandler);
this.$element.bind('plotselected', this.flotSelectHandler);
this.$element.bind('dblclick', this.dblclickHandler);
this.$element.bind('mousedown', this.mousedownHandler);
this.$element.bind('mouseup', this.mouseupHandler);
this.$element.bind('mouseleave', this.mouseleaveHandler);
@ -1219,10 +1221,12 @@ export class TbFlot {
private disableMouseEvents() {
this.$element.css('pointer-events', 'none');
this.$element.removeClass('mouse-events');
this.options.selection = { mode : null };
if (this.chartType !== 'pie') {
this.options.selection = {mode: null};
this.$element.unbind('plotselected', this.flotSelectHandler);
this.$element.unbind('dblclick', this.dblclickHandler);
}
this.$element.unbind('plothover', this.flotHoverHandler);
this.$element.unbind('plotselected', this.flotSelectHandler);
this.$element.unbind('dblclick', this.dblclickHandler);
this.$element.unbind('mousedown', this.mousedownHandler);
this.$element.unbind('mouseup', this.mouseupHandler);
this.$element.unbind('mouseleave', this.mouseleaveHandler);

Loading…
Cancel
Save