From b4553b198b62721b9631f929712499459fc24761 Mon Sep 17 00:00:00 2001 From: Myriam Bouchemit Date: Mon, 18 Mar 2024 11:24:31 +0100 Subject: [PATCH] Fix compatibility mode with histoPlot --- js/app/models/PlotObjects/PlotHistogram1DSerieObject.js | 18 ++++++++++-------- js/app/models/PlotObjects/PlotHistogram2DSerieObject.js | 12 +++++++----- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/js/app/models/PlotObjects/PlotHistogram1DSerieObject.js b/js/app/models/PlotObjects/PlotHistogram1DSerieObject.js index c6e2100..f23b2dd 100644 --- a/js/app/models/PlotObjects/PlotHistogram1DSerieObject.js +++ b/js/app/models/PlotObjects/PlotHistogram1DSerieObject.js @@ -29,14 +29,16 @@ Ext.define('amdaPlotObj.PlotHistogram1DSerieObject', { constructor: function(){ var me = this; - if (!arguments['histo1d-yaxis']) { - // Compatibility mode to support old saved requests - arguments['histo1d-yaxis'] = amdaDefaultValues.plot.histogram1D.histo1DyAxis; - } - if (!arguments['histo1d-style']) { - // Compatibility mode to support old saved requests - arguments['histo1d-style'] = amdaDefaultValues.plot.histogram1D.histo1DStyle; - } + if ((arguments.length > 0) && arguments[0]) { + if (!arguments[0]['histo1d-yaxis']) { + // Compatibility mode to support old saved requests + arguments[0]['histo1d-yaxis'] = amdaDefaultValues.plot.histogram1D.histo1DyAxis; + } + if (!arguments['histo1d-style']) { + // Compatibility mode to support old saved requests + arguments[0]['histo1d-style'] = amdaDefaultValues.plot.histogram1D.histo1DStyle; + } + } me.callParent(arguments); }, diff --git a/js/app/models/PlotObjects/PlotHistogram2DSerieObject.js b/js/app/models/PlotObjects/PlotHistogram2DSerieObject.js index 2a5128d..578d416 100644 --- a/js/app/models/PlotObjects/PlotHistogram2DSerieObject.js +++ b/js/app/models/PlotObjects/PlotHistogram2DSerieObject.js @@ -30,11 +30,13 @@ Ext.define('amdaPlotObj.PlotHistogram2DSerieObject', { constructor: function(){ var me = this; - me.callParent(arguments); - if (!arguments['histo2d-yaxis']) { - // Compatibility mode to support old saved requests - arguments['histo2d-yaxis'] = amdaDefaultValues.plot.histogram2D.histo2DyAxis; - } + if ((arguments.length > 0) && arguments[0]) { + if (!arguments[0]['histo2d-yaxis']) { + // Compatibility mode to support old saved requests + arguments[0]['histo2d-yaxis'] = amdaDefaultValues.plot.histogram2D.histo2DyAxis; + } + } + me.callParent(arguments); }, setDefaultValues: function() -- libgit2 0.21.2