Commit 0891da4829401a44697b87cfed46603a076715fd

Authored by Benjamin Renard
1 parent b3cfb4b8

Fix some bugs with plot plugins registration / unregistration

js/app/views/PlotComponents/PlotExtendShiftPlug.js
... ... @@ -17,7 +17,8 @@
17 17 Ext.define('amdaPlotComp.PlotExtendShiftPlug', {
18 18 extend: 'Ext.util.Observable',
19 19 alias: 'plugin.plotExtendShiftPlugin',
20   -
  20 +
  21 + id: 'plot-extendshift-plug',
21 22 win : null,
22 23 form : null,
23 24 tabId : '',
... ...
js/app/views/PlotComponents/PlotZoomPlug.js
... ... @@ -17,6 +17,8 @@
17 17 Ext.define('amdaPlotComp.PlotZoomPlug', {
18 18 extend: 'Ext.util.Observable',
19 19 alias: 'plugin.plotZoomPlugin',
  20 +
  21 + id: 'plot-zoom-plug',
20 22  
21 23 ttModuleId : 'timetab-win',
22 24  
... ...
js/app/views/PlotTabResultUI.js
... ... @@ -721,9 +721,20 @@ Ext.define('amdaUI.PlotTabResultUI', {
721 721 ptype: 'plotExtendShiftPlugin',
722 722 pluginId : 'plot-extendshift-plugin-id'
723 723 }
724   - ]
  724 + ],
  725 + listeners: {
  726 + scope : this,
  727 + destroy : function () {
  728 + var zoomPlugin = this.getPlugin('plot-zoom-plugin-id');
  729 + if (zoomPlugin)
  730 + zoomPlugin.close();
  731 + var exttendShiftPlugin = this.getPlugin('plot-extendshift-plugin-id');
  732 + if (exttendShiftPlugin)
  733 + exttendShiftPlugin.close();
  734 + }
  735 + }
725 736 };
726   -
  737 +
727 738 Ext.apply(this , plotResultTabPanelConfig);
728 739 }
729 740 });
730 741 \ No newline at end of file
... ...