diff --git a/frontend/assets/AppAsset.php b/frontend/assets/AppAsset.php index 1a17bab..40fff2a 100755 --- a/frontend/assets/AppAsset.php +++ b/frontend/assets/AppAsset.php @@ -23,8 +23,7 @@ class AppAsset extends AssetBundle 'http://fonts.googleapis.com/css?family=Roboto:400,300,700&subset=latin,cyrillic-ext', ]; public $js = [ - //'js/js_head.js', - //'js/js_footer.js', + '/js/artbox_basket.js', 'js/script.js', 'js/new_script.js', diff --git a/frontend/assets/FlipclockAsset.php b/frontend/assets/FlipclockAsset.php index 5a26f26..9fc2a19 100755 --- a/frontend/assets/FlipclockAsset.php +++ b/frontend/assets/FlipclockAsset.php @@ -23,6 +23,7 @@ class FlipclockAsset extends AssetBundle 'flipclock/compiled/flipclock.min.js' ]; public $jsOptions = array( - 'position' => \yii\web\View::POS_END + 'position' => \yii\web\View::POS_END, + 'depends' => ['yii\web\JqueryAsset'] ); } diff --git a/frontend/config/main.php b/frontend/config/main.php index 1113b03..cc41b0c 100755 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -19,7 +19,13 @@ return [ ], 'components' => [ - + 'assetManager' => [ + 'bundles' => [ + 'yii\web\JqueryAsset' =>[ + 'jsOptions' => ['position' => \yii\web\View::POS_END] + ] + ], + ], 'authManager' => [ 'class' => 'yii\rbac\DbManager', ], diff --git a/frontend/views/catalog/product.php b/frontend/views/catalog/product.php index ad4487c..8ba28b9 100755 --- a/frontend/views/catalog/product.php +++ b/frontend/views/catalog/product.php @@ -1,6 +1,7 @@ name,Url::to(['event/show','alias'=>$event->alias,'id'=>$event->primaryKey]))?>
До конца осталось:
- diff --git a/frontend/views/event/_objects.php b/frontend/views/event/_objects.php index d2e0f76..61fe710 100755 --- a/frontend/views/event/_objects.php +++ b/frontend/views/event/_objects.php @@ -1,9 +1,10 @@
@@ -23,13 +24,9 @@ FlipclockAsset::register($this); if(!empty($model->end_at) && strtotime($model->end_at) > strtotime(date("Y-m-d"))){ ?>
- + clock.start();"; + $this->registerJs($js,['position'=>View::POS_END]) ?> - - +
-
- +
diff --git a/frontend/views/layouts/main.php b/frontend/views/layouts/main.php index 126c473..a54b08c 100755 --- a/frontend/views/layouts/main.php +++ b/frontend/views/layouts/main.php @@ -30,7 +30,7 @@ use common\models\Event; - + diff --git a/frontend/widgets/views/slider.php b/frontend/widgets/views/slider.php index 0f8197e..6889a3f 100755 --- a/frontend/widgets/views/slider.php +++ b/frontend/widgets/views/slider.php @@ -20,33 +20,26 @@ FlipclockAsset::register($this); if(!empty($image->end_at) && strtotime($image->end_at) > strtotime(date("Y-m-d"))){ ?>
- + primaryKey ."').FlipClock({ + clockFace: 'DailyCounter', + language: 'ru', + classes: { + active: 'flip-clock-active', + before: 'flip-clock-before', + divider: 'flip-clock-divider', + dot: 'flip-clock-dot', + label: 'flip-clock-label', + flip: 'flip', + play: 'play', + wrapper: 'flip-clock-wrapper' + }, + }); + + clock.setTime(".strtotime($model->end_at) - strtotime(date('Y-m-d H:i:s'))."); + clock.setCountdown(true); + clock.start();"; + $this->registerJs($js,['position'=>View::POS_END]) ?>