diff --git a/js/app/views/PlotComponents/intervalSelection/ZoomIntervalSelection.js b/js/app/views/PlotComponents/intervalSelection/ZoomIntervalSelection.js index 9a7ed2d..10244aa 100644 --- a/js/app/views/PlotComponents/intervalSelection/ZoomIntervalSelection.js +++ b/js/app/views/PlotComponents/intervalSelection/ZoomIntervalSelection.js @@ -4,6 +4,10 @@ Ext.define('amdaPlotComp.intervalSelection.ZoomIntervalSelection', { buttonApply: "Apply Zoom", type: null, + /** + * Initializes the component. + * Adds an 'Undo Zoom' button to the bottom toolbar of the form. + */ initComponent: function () { const self = this; this.callParent(arguments); @@ -17,6 +21,11 @@ Ext.define('amdaPlotComp.intervalSelection.ZoomIntervalSelection', { }); }, + /** + * Applies the zoom based on the values of the fields. + * If the values are not valid, it shows a warning message. + * Otherwise, it calls the interactive plot with the zoom action and resets the host component selection. + */ _apply: function () { if (this._notValidValues()) { myDesktopApp.warningMsg('The Input Values are not defined'); @@ -34,6 +43,10 @@ Ext.define('amdaPlotComp.intervalSelection.ZoomIntervalSelection', { } }, + /** + * Undoes the zoom. + * It calls the interactive plot with the undozoom action and resets the host component selection. + */ _undoZoom: function () { this.hostCmp.callInteractivePlot({ 'action': 'undozoom', -- libgit2 0.21.2