|
4827 | 4827 |
|
4828 | 4828 | JSROOT.THistPainter.prototype.ToggleStat = function(arg) { |
4829 | 4829 |
|
4830 | | - var stat = this.FindStat(); |
| 4830 | + var stat = this.FindStat(), statpainter = null; |
4831 | 4831 |
|
4832 | 4832 | if (stat == null) { |
4833 | 4833 | if (arg=='only-check') return false; |
4834 | 4834 | // when statbox created first time, one need to draw it |
4835 | 4835 | stat = this.CreateStat(); |
4836 | | - |
4837 | | - this.svg_canvas().property('current_pad', this.pad_name); |
4838 | | - JSROOT.draw(this.divid, stat); |
4839 | | - this.svg_canvas().property('current_pad', ''); |
4840 | | - |
4841 | | - return true; |
| 4836 | + } else { |
| 4837 | + statpainter = this.FindPainterFor(stat); |
4842 | 4838 | } |
4843 | 4839 |
|
4844 | | - var statpainter = this.FindPainterFor(stat); |
4845 | | - if (statpainter == null) return false; |
| 4840 | + if (arg=='only-check') return statpainter ? statpainter.Enabled : false; |
4846 | 4841 |
|
4847 | | - if (arg=='only-check') return statpainter.Enabled; |
| 4842 | + if (statpainter) { |
| 4843 | + statpainter.Enabled = !statpainter.Enabled; |
| 4844 | + // when stat box is drawed, it always can be draw individualy while it |
| 4845 | + // should be last for colz RedrawPad is used |
| 4846 | + statpainter.Redraw(); |
| 4847 | + return statpainter.Enabled; |
| 4848 | + } |
4848 | 4849 |
|
4849 | | - statpainter.Enabled = !statpainter.Enabled; |
4850 | | - // when stat box is drawed, it always can be draw individualy while it |
4851 | | - // should be last for colz RedrawPad is used |
4852 | | - statpainter.Redraw(); |
| 4850 | + this.svg_canvas().property('current_pad', this.pad_name); |
| 4851 | + JSROOT.draw(this.divid, stat); |
| 4852 | + this.svg_canvas().property('current_pad', ''); |
4853 | 4853 |
|
4854 | | - return statpainter.Enabled; |
| 4854 | + return true; |
4855 | 4855 | } |
4856 | 4856 |
|
4857 | 4857 | JSROOT.THistPainter.prototype.IsAxisZoomed = function(axis) { |
|
0 commit comments