..F....... [ZBXNEXT-2215] minor JS code refactoring