diff options
author | Anton Luka Šijanec <sijanecantonluka@gmail.com> | 2020-02-20 23:51:05 +0100 |
---|---|---|
committer | Anton Luka Šijanec <sijanecantonluka@gmail.com> | 2020-02-20 23:51:05 +0100 |
commit | f9bc2be316b415cdd99a6f1c42f61ccf55817092 (patch) | |
tree | f5ea4351014621ec8380300bceb3cbe69f5a6c4a /js/messaging.js | |
parent | podčrtica ni minus (diff) | |
download | beziapp-f9bc2be316b415cdd99a6f1c42f61ccf55817092.tar beziapp-f9bc2be316b415cdd99a6f1c42f61ccf55817092.tar.gz beziapp-f9bc2be316b415cdd99a6f1c42f61ccf55817092.tar.bz2 beziapp-f9bc2be316b415cdd99a6f1c42f61ccf55817092.tar.lz beziapp-f9bc2be316b415cdd99a6f1c42f61ccf55817092.tar.xz beziapp-f9bc2be316b415cdd99a6f1c42f61ccf55817092.tar.zst beziapp-f9bc2be316b415cdd99a6f1c42f61ccf55817092.zip |
Diffstat (limited to 'js/messaging.js')
-rw-r--r-- | js/messaging.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/js/messaging.js b/js/messaging.js index 4ea8502..ed53880 100644 --- a/js/messaging.js +++ b/js/messaging.js @@ -69,13 +69,14 @@ function loadDirectory() { function populateAutocomplete() { let elems = document.querySelectorAll('.autocomplete-fullname'); - - // vse editam v nanotu - let autocomplete_entries = directory; + // če se uporablja globalna var directory, ki je shranjena kot objekt (vedno shranjen kot reference), bo pri let x=y x le pointer na object y + // in se bo spremenil z spremembo "originala". spodnja stvar itak ni preveč efficent, loop čez vseh 7000 ljudi bi lahko delal težave... + // kakšen Object.keys bi bila boljša varianta ampak raje napišem tale komentar... idk, to se mi je zdelo uporabno ampak sedaj obžalujem + // samo guglal sem "copying an object js" + let autocomplete_entries = Object.assign({}, directory); for (let variableKey in autocomplete_entries) { autocomplete_entries[variableKey] = null; } - M.Autocomplete.init(elems, { data: autocomplete_entries, onAutocomplete: validateName, |