Commit 9a61eac914bac039f6f15001d55380120377f5a3

Authored by Administrator
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,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 //alert(1); 89 //alert(1);
93 $('.toolbar-list').addClass('selected'); 90 $('.toolbar-list').addClass('selected');
94 $('.toolbar-grid').removeClass('selected'); 91 $('.toolbar-grid').removeClass('selected');
@@ -96,7 +93,7 @@ use yii\helpers\Url; @@ -96,7 +93,7 @@ use yii\helpers\Url;
96 JsHttpRequest.query( 93 JsHttpRequest.query(
97 'hr_gate.php?test=500&r='+Math.random(), 94 'hr_gate.php?test=500&r='+Math.random(),
98 { 95 {
99 - 'sp': "prod_list_style" 96 + 'sp': 'prod_list_style'
100 ,'style': 1 97 ,'style': 1
101 }, 98 },
102 function(result, errors) { }, 99 function(result, errors) { },
@@ -110,17 +107,17 @@ use yii\helpers\Url; @@ -110,17 +107,17 @@ use yii\helpers\Url;
110 JsHttpRequest.query( 107 JsHttpRequest.query(
111 'hr_gate.php?test=500&r='+Math.random(), 108 'hr_gate.php?test=500&r='+Math.random(),
112 { 109 {
113 - 'sp': "prod_list_style" 110 + 'sp': 'prod_list_style'
114 ,'style': 2 111 ,'style': 2
115 }, 112 },
116 function(result, errors) { }, 113 function(result, errors) { },
117 true //disable caching 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