cleaner static variable in downloadDictionary function
authorLaurent Mazet <mazet@softndesign.org>
Wed, 10 Jun 2020 21:01:37 +0000 (23:01 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Wed, 10 Jun 2020 21:01:37 +0000 (23:01 +0200)
public/trivabble.js

index d84a5baf4caa6e0b8f55304bff6273cca96e80ec..37f9a5f1042e6d4ce49ab9c9370fb762402e5204 100644 (file)
     }
 
     function downloadDictionary(code) {
-        if (typeof downloadDictionary.code === "undefined") {
-            downloadDictionary.code = "";
-        } else if (downloadDictionary.code === code) {
+        /* static variable */
+        if (downloadDictionary.code === code) {
             return;
         }
         downloadDictionary.code = code;
             }
         };
         file.send(null);
-        return;
     }
 
     function removeElem(elem) {