Commit 9a61eac914bac039f6f15001d55380120377f5a3
1 parent
ed6cd945
big commti
Showing
1 changed file
with
6 additions
and
9 deletions
Show diff stats
frontend/views/catalog/products.php
| ... | ... | @@ -85,10 +85,7 @@ use yii\helpers\Url; |
| 85 | 85 | |
| 86 | 86 | |
| 87 | 87 | |
| 88 | - | |
| 89 | - <script language="JavaScript"> | |
| 90 | - $(document).ready(function(){ | |
| 91 | - $('.toolbar-list').click(function(event) { | |
| 88 | + <?php $js = "$('.toolbar-list').click(function(event) { | |
| 92 | 89 | //alert(1); |
| 93 | 90 | $('.toolbar-list').addClass('selected'); |
| 94 | 91 | $('.toolbar-grid').removeClass('selected'); |
| ... | ... | @@ -96,7 +93,7 @@ use yii\helpers\Url; |
| 96 | 93 | JsHttpRequest.query( |
| 97 | 94 | 'hr_gate.php?test=500&r='+Math.random(), |
| 98 | 95 | { |
| 99 | - 'sp': "prod_list_style" | |
| 96 | + 'sp': 'prod_list_style' | |
| 100 | 97 | ,'style': 1 |
| 101 | 98 | }, |
| 102 | 99 | function(result, errors) { }, |
| ... | ... | @@ -110,17 +107,17 @@ use yii\helpers\Url; |
| 110 | 107 | JsHttpRequest.query( |
| 111 | 108 | 'hr_gate.php?test=500&r='+Math.random(), |
| 112 | 109 | { |
| 113 | - 'sp': "prod_list_style" | |
| 110 | + 'sp': 'prod_list_style' | |
| 114 | 111 | ,'style': 2 |
| 115 | 112 | }, |
| 116 | 113 | function(result, errors) { }, |
| 117 | 114 | true //disable caching |
| 118 | 115 | ); |
| 119 | 116 | |
| 120 | - }); | |
| 117 | + });"; | |
| 118 | + $this->registerJs($js,View::POS_READY); | |
| 119 | + ?> | |
| 121 | 120 | |
| 122 | - }); | |
| 123 | - </script> | |
| 124 | 121 | |
| 125 | 122 | |
| 126 | 123 | ... | ... |