-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
63 lines (59 loc) · 1.64 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
const App = {
map: null,
dbConfig: {
},
database: null,
table: null,
markerPath: 'images/markers/',
iconPath: 'images/icons/',
selectedSign: null,
signList: new Array(),
markerList: new Array(),
ids: new Array(),
activeFilters: new Array(),
inactiveFilters: new Array(),
states: {
nameValue: '',
categoryId: '',
categoryValue: '',
bentId: '',
bentValue: '',
dirPathValue: '',
ov_errors: [],
isMoving: false,
movingCoords: null,
createCoords: null,
isCreating: null,
},
filterIsActive: (identifier) => {
for(let key in App.activeFilters){
let filter = App.activeFilters[key];
if(filter.type === identifier.type && filter.id == identifier.id){
return true;
}
}
return false;
},
indexOfFilter: (identifier, mode) => {
switch(mode){
case 'active':
for(let key in App.activeFilters){
let filter = App.activeFilters[key];
if(filter.type === identifier.type && filter.id == identifier.id){
return key;
}
}
break;
case 'inactive':
for(let key in App.inactiveFilters){
let filter = App.inactiveFilters[key];
if(filter.type === identifier.type && filter.id == identifier.id){
return key;
}
}
break;
}
return -1;
}
}
module.exports = App;