-
Notifications
You must be signed in to change notification settings - Fork 1
/
script.js
45 lines (38 loc) · 1.1 KB
/
script.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
var selectedLocation = {
city: DEFAULT_LOCATION.city,
country: DEFAULT_LOCATION.country,
loc: DEFAULT_LOCATION.loc,
};
var selectedCity = selectedLocation.city;
var events = [];
var categories = [];
$(document).ready(function () {
getIPInfoFromLocalStorage();
getDataFromSeatgeekByCityName(selectedCity)
.then(serializedSeatgeekDataByUpcomingEvents)
.then(serializedEventCategoriesFromSeatgeek)
.then(function () {
renderEventsSection();
renderSearchByCategoryDropdown(categories);
})
.catch(function (error) {
console.error(error);
});
SEARCH_BTN.click(function () {
selectedCity = $(INPUT_EL).val();
//TODO add logic
getDataFromSeatgeekByCityName(selectedCity)
.then(serializedSeatgeekDataByUpcomingEvents)
.then(serializedEventCategoriesFromSeatgeek)
.then(function () {
renderEventsSection();
renderSearchByCategoryDropdown(categories);
})
.catch(function (error) {
console.error(error);
});
});
CATEGORIES_SEARCH_DROPDOWN_UL.onchange = function () {
console.log(this.value);
};
});