From 5c2c1634381d04916d5ca0ca4637f67e68ab09d4 Mon Sep 17 00:00:00 2001 From: Alexander Zolotarev Date: Wed, 9 Aug 2017 11:56:06 +0300 Subject: [PATCH] fix open lesson --- templates/course.html | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/templates/course.html b/templates/course.html index 7f08e18..76e9b1e 100755 --- a/templates/course.html +++ b/templates/course.html @@ -350,20 +350,22 @@ // Проверка доступности уроков(старт потока) // если поток открыт редирект на урок - $('.flow').on('click', function(e){ - e.preventDefault(); - var path = document.location.pathname; - $.get(path, function(data){ - _flow = $(data).find('.flow').attr('href'); - if (_flow === '#'){ - $('#flowAccess').modal('show'); - } - else { - document.location.href = _flow; - } - //console.log(_flow); + if ($('.flow').attr('href') === '#') { + $('.flow').on('click', function(e){ + e.preventDefault(); + var path = document.location.pathname; + $.get(path, function(data){ + _flow = $(data).find('.flow').attr('href'); + if (_flow === '#'){ + $('#flowAccess').modal('show'); + } + else { + document.location.href = _flow; + } + //console.log(_flow); + }); }); - }); + } if(flow == 'False'){ $('#flowAccess').modal('show');