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
frontend/views/event/_objects.php
| ... | ... | @@ -44,7 +44,7 @@ FlipclockAsset::register($this); |
| 44 | 44 | clock.setTime(".strtotime($model->end_at) - strtotime(date('Y-m-d H:i:s'))."); |
| 45 | 45 | clock.setCountdown(true); |
| 46 | 46 | clock.start();"; |
| 47 | - $this->registerJs($js,['position'=>View::POS_END]) ?> | |
| 47 | + $this->registerJs($js,View::POS_END) ?> | |
| 48 | 48 | |
| 49 | 49 | <?php}?> |
| 50 | 50 | </div> | ... | ... |
frontend/views/event/show.php
| 1 | 1 | <?php |
| 2 | 2 | use frontend\assets\FlipclockAsset; |
| 3 | 3 | use yii\helpers\Url; |
| 4 | +use yii\web\View; | |
| 4 | 5 | use yii\widgets\Breadcrumbs; |
| 5 | 6 | use yii\widgets\ListView; |
| 6 | 7 | |
| ... | ... | @@ -27,11 +28,8 @@ $this->params['seo']['h1'] = $this->title; |
| 27 | 28 | if(!empty($model->end_at) && strtotime($model->end_at) > strtotime(date("Y-m-d"))){ |
| 28 | 29 | ?> |
| 29 | 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 | 34 | clock = $('.clock').FlipClock({ |
| 37 | 35 | clockFace: 'DailyCounter', |
| ... | ... | @@ -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 | 55 | <?php | ... | ... |
frontend/widgets/views/slider.php
| ... | ... | @@ -39,7 +39,7 @@ FlipclockAsset::register($this); |
| 39 | 39 | clock.setTime(".strtotime($image->end_at) - strtotime(date('Y-m-d H:i:s'))."); |
| 40 | 40 | clock.setCountdown(true); |
| 41 | 41 | clock.start();"; |
| 42 | - $this->registerJs($js,['position'=>View::POS_END]) ?> | |
| 42 | + $this->registerJs($js,View::POS_END) ?> | |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | <?php | ... | ... |