Commit 0c31f47aabf2b2a33d2a1959e3517c83c8a04c3d

Authored by Timur Kastemirov
1 parent 43c0ab09

bug fix

frontend/views/site/legal.php
@@ -5,23 +5,27 @@ @@ -5,23 +5,27 @@
5 * @var Feedback $contact 5 * @var Feedback $contact
6 */ 6 */
7 7
8 -use artbox\core\models\Feedback;  
9 -use common\models\Settings;  
10 -use frontend\assets\MapAsset;  
11 -use yii\helpers\Html;  
12 -use yii\bootstrap\ActiveForm;  
13 -use yii\web\View;  
14 -  
15 -MapAsset::register($this);  
16 -$settings = Settings::getInstance();  
17 -$seo = \Yii::$app->get('seo');  
18 -  
19 -$this->params['h1'] = $seo->h1;  
20 -$this->params[ 'breadcrumbs' ][] = \Yii::t('app', 'menu-legal');  
21 -  
22 -$js = <<< JS  
23 -window.lat = {$settings->lat};  
24 -window.lon = {$settings->lon}; 8 + use artbox\core\models\Feedback;
  9 + use common\models\Settings;
  10 + use frontend\assets\MapAsset;
  11 + use yii\helpers\Html;
  12 + use yii\bootstrap\ActiveForm;
  13 + use yii\web\View;
  14 +
  15 + MapAsset::register($this);
  16 + $settings = Settings::getInstance();
  17 + $seo = \Yii::$app->get('seo');
  18 +
  19 + $this->params['h1'] = $seo->h1;
  20 + $this->params[ 'breadcrumbs' ][] = \Yii::t('app', 'menu-legal');
  21 +
  22 + $coordinates = [];
  23 + $coordinates['lat'] = empty($settings->lat) ? 0 : $settings->lat;
  24 + $coordinates['lon'] = empty($settings->lon) ? 0 : $settings->lon;
  25 +
  26 + $js = <<< JS
  27 +window.lat = {$coordinates['lat']};
  28 +window.lon = {$coordinates['lon']};
25 JS; 29 JS;
26 30
27 $this->registerJs($js, View::POS_END); 31 $this->registerJs($js, View::POS_END);
frontend/web/js/gmaps.init.js
@@ -25,6 +25,6 @@ $( @@ -25,6 +25,6 @@ $(
25 25
26 } 26 }
27 27
28 - window.initMap = initMap(); 28 + window.initMap = initMap;
29 } 29 }
30 ); 30 );