From 6c702a03591d7d0c622a5338d5d28bc4bb1c223a Mon Sep 17 00:00:00 2001
From: "francois.grand" <francois.grand@irstea.fr>
Date: Mon, 12 Mar 2018 12:14:49 +0100
Subject: [PATCH] =?UTF-8?q?=20#27=20:=20NgParamInputComponent=20:=20correc?=
 =?UTF-8?q?tion=20d'un=20bug=20emp=C3=AAchant=20de=20saisir=20un=20'.'?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../ngparam-input/ngparam-input.component.ts  | 24 ++++----
 src/app/formulaire/ngparam.ts                 | 58 +++++++++----------
 2 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/src/app/components/ngparam-input/ngparam-input.component.ts b/src/app/components/ngparam-input/ngparam-input.component.ts
index 23cd83d34..803076aeb 100644
--- a/src/app/components/ngparam-input/ngparam-input.component.ts
+++ b/src/app/components/ngparam-input/ngparam-input.component.ts
@@ -14,7 +14,7 @@ import { Observer, IObservable } from "../../services/observer";
     selector: "ngparam-input",
     templateUrl: "../generic-input/generic-input.component.html"
 })
-export class NgParamInputComponent extends GenericInputComponent implements Observer {
+export class NgParamInputComponent extends GenericInputComponent { // implements Observer {
     /**
      * paramètre géré
      */
@@ -35,10 +35,10 @@ export class NgParamInputComponent extends GenericInputComponent implements Obse
     /**
      * appelé avant le changement de modèle
      */
-    protected beforeSetModel() {
-        if (this._paramDef != undefined)
-            this._paramDef.removeObserver(this);
-    }
+    // protected beforeSetModel() {
+    //     if (this._paramDef != undefined)
+    //         this._paramDef.removeObserver(this);
+    // }
 
     /**
      * appelé après le changement de modèle
@@ -47,7 +47,7 @@ export class NgParamInputComponent extends GenericInputComponent implements Obse
         if (this._paramDef != undefined) {
             if (this._paramDef.isDefined)
                 this._tmp = this._paramDef.getValue();
-            this._paramDef.addObserver(this);
+            // this._paramDef.addObserver(this);
         }
     }
 
@@ -107,10 +107,10 @@ export class NgParamInputComponent extends GenericInputComponent implements Obse
         return +ui;
     }
 
-    public update(sender: IObservable, data: any): void {
-        if (data["action"] == "value") {
-            this._tmp = data["value"];
-            this.updateAndValidateUI();
-        }
-    }
+    // public update(sender: IObservable, data: any): void {
+    //     if (data["action"] == "value") {
+    //         this._tmp = data["value"];
+    //         this.updateAndValidateUI();
+    //     }
+    // }
 }
diff --git a/src/app/formulaire/ngparam.ts b/src/app/formulaire/ngparam.ts
index c568c56b5..f054d4ffa 100644
--- a/src/app/formulaire/ngparam.ts
+++ b/src/app/formulaire/ngparam.ts
@@ -44,7 +44,7 @@ export enum ParamValueMode {
 /**
  * classe englobante de ParamDefinition (champs supplémentaires pour l'affichage, radio boutons, ...)
  */
-export class NgParameter extends InputField implements IObservable {
+export class NgParameter extends InputField { // implements IObservable {
     public unit: string;
     public radioConfig: ParamRadioConfig;
     public radioState: ParamRadioConfig;
@@ -99,12 +99,12 @@ export class NgParameter extends InputField implements IObservable {
 
     public setValue(val: number) {
         this._paramDef.v = val;
-        this.notifyObservers(
-            {
-                "action": "value",
-                "value": val
-            }
-        )
+        // this.notifyObservers(
+        //     {
+        //         "action": "value",
+        //         "value": val
+        //     }
+        // )
     }
 
     get isDefined(): boolean {
@@ -327,26 +327,26 @@ export class NgParameter extends InputField implements IObservable {
         return new NgParameter(this._paramDef.clone());
     }
 
-    // interface IObservable
-
-    /**
-     * ajoute un observateur à la liste
-     */
-    public addObserver(o: Observer) {
-        this._observable.addObserver(o);
-    }
-
-    /**
-     * supprime un observateur de la liste
-     */
-    public removeObserver(o: Observer) {
-        this._observable.removeObserver(o);
-    }
-
-    /**
-     * notifie un événement aux observateurs
-     */
-    public notifyObservers(data: any) {
-        this._observable.notifyObservers(data, this);
-    }
+    // // interface IObservable
+
+    // /**
+    //  * ajoute un observateur à la liste
+    //  */
+    // public addObserver(o: Observer) {
+    //     this._observable.addObserver(o);
+    // }
+
+    // /**
+    //  * supprime un observateur de la liste
+    //  */
+    // public removeObserver(o: Observer) {
+    //     this._observable.removeObserver(o);
+    // }
+
+    // /**
+    //  * notifie un événement aux observateurs
+    //  */
+    // public notifyObservers(data: any) {
+    //     this._observable.notifyObservers(data, this);
+    // }
 }
-- 
GitLab