Commit 14e34aa952e27fd923a79bd7b4a1d6717132dacb
1 parent
5aff86d0
big commti
Showing
4 changed files
with
10 additions
and
14 deletions
Show diff stats
frontend/views/catalog/product.php
@@ -201,7 +201,7 @@ use frontend\assets\FlipclockAsset; | @@ -201,7 +201,7 @@ use frontend\assets\FlipclockAsset; | ||
201 | clock.setCountdown(true); | 201 | clock.setCountdown(true); |
202 | clock.start(); | 202 | clock.start(); |
203 | "; | 203 | "; |
204 | - $this->registerJs($js,['position'=>View::POS_END]) | 204 | + $this->registerJs($js,View::POS_END) |
205 | ?> | 205 | ?> |
206 | 206 | ||
207 | 207 |
frontend/views/event/_objects.php
@@ -44,7 +44,7 @@ FlipclockAsset::register($this); | @@ -44,7 +44,7 @@ FlipclockAsset::register($this); | ||
44 | clock.setTime(".strtotime($model->end_at) - strtotime(date('Y-m-d H:i:s'))."); | 44 | clock.setTime(".strtotime($model->end_at) - strtotime(date('Y-m-d H:i:s'))."); |
45 | clock.setCountdown(true); | 45 | clock.setCountdown(true); |
46 | clock.start();"; | 46 | clock.start();"; |
47 | - $this->registerJs($js,['position'=>View::POS_END]) ?> | 47 | + $this->registerJs($js,View::POS_END) ?> |
48 | 48 | ||
49 | <?php}?> | 49 | <?php}?> |
50 | </div> | 50 | </div> |
frontend/views/event/show.php
1 | <?php | 1 | <?php |
2 | use frontend\assets\FlipclockAsset; | 2 | use frontend\assets\FlipclockAsset; |
3 | use yii\helpers\Url; | 3 | use yii\helpers\Url; |
4 | +use yii\web\View; | ||
4 | use yii\widgets\Breadcrumbs; | 5 | use yii\widgets\Breadcrumbs; |
5 | use yii\widgets\ListView; | 6 | use yii\widgets\ListView; |
6 | 7 | ||
@@ -27,11 +28,8 @@ $this->params['seo']['h1'] = $this->title; | @@ -27,11 +28,8 @@ $this->params['seo']['h1'] = $this->title; | ||
27 | if(!empty($model->end_at) && strtotime($model->end_at) > strtotime(date("Y-m-d"))){ | 28 | if(!empty($model->end_at) && strtotime($model->end_at) > strtotime(date("Y-m-d"))){ |
28 | ?> | 29 | ?> |
29 | <div class="clock_style clock"></div> | 30 | <div class="clock_style clock"></div> |
30 | - <script type="text/javascript"> | ||
31 | - var clock; | ||
32 | - | ||
33 | - $(document).ready(function() { | ||
34 | - var clock; | 31 | + <?php $js = " |
32 | + var clock; | ||
35 | 33 | ||
36 | clock = $('.clock').FlipClock({ | 34 | clock = $('.clock').FlipClock({ |
37 | clockFace: 'DailyCounter', | 35 | clockFace: 'DailyCounter', |
@@ -48,12 +46,10 @@ $this->params['seo']['h1'] = $this->title; | @@ -48,12 +46,10 @@ $this->params['seo']['h1'] = $this->title; | ||
48 | }, | 46 | }, |
49 | }); | 47 | }); |
50 | 48 | ||
51 | - clock.setTime(<?= strtotime($model->end_at) - strtotime(date("Y-m-d H:i:s"))?>); | ||
52 | - clock.setCountdown(true); | ||
53 | - clock.start(); | ||
54 | - | ||
55 | - }); | ||
56 | - </script> | 49 | + clock.setTime(".strtotime($model->end_at) - strtotime(date('Y-m-d H:i:s'))."); |
50 | + clock.setCountdown(true); | ||
51 | + clock.start();"; | ||
52 | + $this->registerJs($js,View::POS_END) ?> | ||
57 | 53 | ||
58 | 54 | ||
59 | <?php | 55 | <?php |
frontend/widgets/views/slider.php
@@ -39,7 +39,7 @@ FlipclockAsset::register($this); | @@ -39,7 +39,7 @@ FlipclockAsset::register($this); | ||
39 | clock.setTime(".strtotime($image->end_at) - strtotime(date('Y-m-d H:i:s'))."); | 39 | clock.setTime(".strtotime($image->end_at) - strtotime(date('Y-m-d H:i:s'))."); |
40 | clock.setCountdown(true); | 40 | clock.setCountdown(true); |
41 | clock.start();"; | 41 | clock.start();"; |
42 | - $this->registerJs($js,['position'=>View::POS_END]) ?> | 42 | + $this->registerJs($js,View::POS_END) ?> |
43 | 43 | ||
44 | 44 | ||
45 | <?php | 45 | <?php |