import ru from 'moment/locale/ru';
import lazysizes from 'lazysizes';

import Locations from './locations';
import Options from './options';

import LocationChooser from './location-chooser';
import EventsView from './events';

import {show, hide} from './utils';


document.addEventListener('DOMContentLoaded', function(event) {
  const options = new Options();
  const locations = new Locations();

  Promise.all([
    locations.fetch(),
    options.fetch()
  ]).then(() => {
    const locationContainer = document.querySelector('#city');
    const viewContainer = document.querySelector('#view-container');

    const locationChooser = new LocationChooser(locations, options);
    locationChooser.render();
    locationContainer.appendChild(locationChooser.element);

    const eventsView = new EventsView(options);
    eventsView.render();
    viewContainer.appendChild(eventsView.element);

    show(locationContainer);
  });
});

@@ -400,68 +400,24 @@
 %0A%0A  
-Promise.all(%5B%0A    locations.fetch(),%0A    options.fetch()%0A  %5D
+locations.fetch(
 ).th
@@ -494,78 +494,8 @@
 ');%0A
-    const viewContainer = document.querySelector('#view-container');%0A%0A
     
@@ -644,24 +644,160 @@
 er.element);
+%0A    show(locationContainer);%0A  %7D);%0A%0A  options.fetch().then(() =%3E %7B%0A    const viewContainer = document.querySelector('#view-container');
 %0A%0A    const 
@@ -913,38 +913,8 @@
 nt);
-%0A%0A    show(locationContainer);
 %0A  %7D

Load location chooser separately from options and everything