Commit 55fa3bbc4248592b1c1fcd9da45590152344de89

Authored by Benjamin Renard
1 parent e2a002b9

Reset plot request modifications when PlotUI is closed (#8772) + Fix modifications check

js/app/controllers/PlotModule.js
... ... @@ -210,6 +210,7 @@ Ext.define('amdaDesktop.PlotModule', {
210 210 var win = desktop.getWindow(this.id);
211 211 if (win) {
212 212 // Plot UI is opened => add plot in a new tab
  213 + me.linkedNode.get('object').plots().add(plotNode);
213 214 me.getUiContent().editPlot(plotNode);
214 215 win.show();
215 216 }
... ...
js/app/views/PlotComponents/PlotTabContent.js
... ... @@ -256,6 +256,9 @@ Ext.define('amdaPlotComp.PlotTabContent', {
256 256 afterrender: function(comp, eOpts) {
257 257 this.updateUI();
258 258 },
  259 + beforedestroy: function(comp, eOpts) {
  260 + this.resetModif();
  261 + },
259 262 scope: this
260 263 }
261 264 };
... ...
js/app/views/PlotComponents/PlotTabPanel.js
... ... @@ -48,6 +48,15 @@ Ext.define('amdaPlotComp.PlotTabPanel', {
48 48 }
49 49 }
50 50 },
  51 +
  52 + isDirty : function() {
  53 + var dirty = false;
  54 + this.multiplot_object.plots().each(function (rec, index) {
  55 + if (rec.get('object').get('id') != '')
  56 + dirty |= rec.get('object').isDirty();
  57 + });
  58 + return dirty;
  59 + },
51 60  
52 61 addPlotNode: function(plotNode, selectTab)
53 62 {
... ...
js/app/views/PlotUI.js
... ... @@ -96,8 +96,8 @@ Ext.define('amdaUI.PlotUI', {
96 96 var module = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id);
97 97 if (module)
98 98 module.closeInteractiveSession();
99   -
100   - return this.object.isDirty();
  99 +
  100 + return this.plotTabs.isDirty();
101 101 },
102 102  
103 103 /**
... ...