(function() {
  'use strict';

  window.utils = window.utils || {};

  window.utils.aside = function(asideEl) {

    function init() {
      var favoritesBtn = document.querySelector('.navbar__list-item--favorite');
      favoritesBtn.addEventListener('click', function(event) {
        favoritesBtn.classList.toggle('navbar__list-item--active');
        asideEl.classList.toggle('main__aside--expanded');
        event.preventDefault();
      }, true);
    }
    init();
  };
})();

document.addEventListener('DOMContentLoaded', function() {
  var asidenavEl = document.querySelector('.main__aside');
  window.utils.aside(asidenavEl);
});
