(function() { "use strict"; angular.module("raz") .service("correlationResourceDrawerService", ["$q", "$document", function ($q, $document) { var openDrawerId = null; function closeOpenDrawers(duration) { var x = Array.from($document[0].getElementsByClassName("js-lesson-drawer")).filter(function (elem) { return elem.style.display !== 'none'; }); return $q.when(angular.element(x).slideToggle(duration, "linear").promise()); } function openDrawer(drawerId, duration) { openDrawerId = drawerId; return $q.when(angular.element("#drawer_" + drawerId).slideToggle(duration, "linear").promise()); } return { closeOpenDrawers: closeOpenDrawers, openDrawer: openDrawer }; }]); })();