Skip to content

Commit 9383cce

Browse files
committed
fix variables names
1 parent 68d3cbc commit 9383cce

File tree

1 file changed

+11
-20
lines changed

1 file changed

+11
-20
lines changed

views/sort.php

100755100644
Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
<?php
2-
3-
# @Copyright 2017 Rafal Marguzewicz pceuropa.net
4-
52
pceuropa\sort\SortAsset::register($this);
63
use yii\helpers\Html;
74
use yii\helpers\Url;
85

96
$return = '';
107
$el = '';
118

9+
foreach ($list as $item){
1210

13-
#print_r($items);die();
14-
foreach ($items as $item){
15-
if (isset($item['image']) ){
16-
17-
$el = Html::img( $config['image_url'] .$item['image'], ['class' => 'img-responsive', 'alt' => isset($item['name']) ? $item['name'] : '']);
11+
if ($item['image'] != null){
12+
$el = Html::img( $config['image_url'] .$item['image'], ['class' => 'img-responsive', 'alt' => $item['name']]);
1813
} else {
1914
$el = Html::a ( $item['name'], $item['url'] );
2015
}
@@ -49,24 +44,20 @@
4944

5045
$this->registerJs('var config = {
5146
group: "pclista",
47+
animation: 0,
5248
ghostClass: "ghost",
5349
onUpdate: function () {
54-
var a = [], data = {};
50+
var a = [];
51+
52+
$("#lista li").each(function (){ a.push($(this)[0].id) })
5553
56-
$("#lista li").each(function (){ a.push($(this)[0].id) });
57-
data = { serialize: true, array: a };
58-
5954
$.ajax({
60-
url: '.$config["controller"].',
55+
url: document.URL,
6156
type: "post",
6257
dataType:"JSON",
63-
data: data,
64-
success: function (response) {
65-
if (response.success === false) {console.log(response);}
66-
if (response.success === true) {
67-
$("#message_request").text(JSON.stringify(data, null, 4));
68-
$("#message_response").text(JSON.stringify(response, null, 4));
69-
console.log(response);}
58+
data: { serialize: true, array: a },
59+
success: function (r) {
60+
if (r.success === false) {console.log(r.message);}
7061
},
7162
error: function (XMLHttpRequest, textStatus, errorThrown) {
7263
alert(textStatus);

0 commit comments

Comments
 (0)