diff app/view/window/GenProbenFromMessprogramm.js @ 818:097d4edc2f00

Genprobenwindow can only be created once, also fixed messprogrammortewindow 'close with x and can not reopen' bug
author Dustin Demuth <dustin@intevation.de>
date Fri, 29 May 2015 09:05:06 +0200
parents 188a9faf96e0
children 00072c3c926e
line wrap: on
line diff
--- a/app/view/window/GenProbenFromMessprogramm.js	Fri May 29 08:31:19 2015 +0200
+++ b/app/view/window/GenProbenFromMessprogramm.js	Fri May 29 09:05:06 2015 +0200
@@ -21,10 +21,21 @@
     constrain: true,
 
     record: null,
+    parentWindow: null,
 
     initComponent: function() {
         var i18n = Lada.getApplication().bundle;
 
+        // add listeners to change the window appearence when it becomes inactive
+        this.on({
+            activate: function(){
+                this.getEl().removeCls('window-inactive');
+            },
+            deactivate: function(){
+                this.getEl().addCls('window-inactive');
+            }
+        });
+
         this.title = i18n.getMsg('gpfm.window.title');
         var me = this;
         this.buttons = [{
@@ -76,7 +87,7 @@
                                     'Der Server konnte die Anfrage nicht authentifizieren.<br/>'+
                                     'Für ein erneutes Login muss die Anwendung neu geladen werden.<br/>' +
                                     'Alle ungesicherten Daten gehen dabei verloren.<br/>' +
-                                    'Soll die Anwendung jetzt neu geladen werden?', this.reload);
+                                    'Soll die Anwendung jetzt neu geladen werden?', me.reload); //TODO Scope?
                             }
                             else if(json.message){
                                 Ext.Msg.alert(Lada.getApplication().bundle.getMsg('err.msg.generic.title')
@@ -104,6 +115,9 @@
             },
             deactivate: function(){
                 this.getEl().addCls('window-inactive');
+            },
+            close: function () {
+                this.parentWindow.probenWindow = null;
             }
         });
 

http://lada.wald.intevation.org