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