From 0c31f47aabf2b2a33d2a1959e3517c83c8a04c3d Mon Sep 17 00:00:00 2001 From: timur Date: Tue, 24 Apr 2018 14:48:02 +0300 Subject: [PATCH] bug fix --- frontend/views/site/legal.php | 38 +++++++++++++++++++++----------------- frontend/web/js/gmaps.init.js | 2 +- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/frontend/views/site/legal.php b/frontend/views/site/legal.php index 686331a..4c14718 100755 --- a/frontend/views/site/legal.php +++ b/frontend/views/site/legal.php @@ -5,23 +5,27 @@ * @var Feedback $contact */ -use artbox\core\models\Feedback; -use common\models\Settings; -use frontend\assets\MapAsset; -use yii\helpers\Html; -use yii\bootstrap\ActiveForm; -use yii\web\View; - -MapAsset::register($this); -$settings = Settings::getInstance(); -$seo = \Yii::$app->get('seo'); - -$this->params['h1'] = $seo->h1; -$this->params[ 'breadcrumbs' ][] = \Yii::t('app', 'menu-legal'); - -$js = <<< JS -window.lat = {$settings->lat}; -window.lon = {$settings->lon}; + use artbox\core\models\Feedback; + use common\models\Settings; + use frontend\assets\MapAsset; + use yii\helpers\Html; + use yii\bootstrap\ActiveForm; + use yii\web\View; + + MapAsset::register($this); + $settings = Settings::getInstance(); + $seo = \Yii::$app->get('seo'); + + $this->params['h1'] = $seo->h1; + $this->params[ 'breadcrumbs' ][] = \Yii::t('app', 'menu-legal'); + + $coordinates = []; + $coordinates['lat'] = empty($settings->lat) ? 0 : $settings->lat; + $coordinates['lon'] = empty($settings->lon) ? 0 : $settings->lon; + + $js = <<< JS +window.lat = {$coordinates['lat']}; +window.lon = {$coordinates['lon']}; JS; $this->registerJs($js, View::POS_END); diff --git a/frontend/web/js/gmaps.init.js b/frontend/web/js/gmaps.init.js index 58e3d00..1527ae8 100755 --- a/frontend/web/js/gmaps.init.js +++ b/frontend/web/js/gmaps.init.js @@ -25,6 +25,6 @@ $( } - window.initMap = initMap(); + window.initMap = initMap; } ); -- libgit2 0.21.4