Skip to content

Commit

Permalink
Merge pull request #110 from Hlavtox/fix-sorting
Browse files Browse the repository at this point in the history
Fix sorting of slides
  • Loading branch information
Hlavtox authored Sep 25, 2024
2 parents d17c68a + 3237547 commit a6f6125
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>ps_imageslider</name>
<displayName><![CDATA[Image slider]]></displayName>
<version><![CDATA[3.2.0]]></version>
<version><![CDATA[3.2.1]]></version>
<description><![CDATA[Adds an image slider to your site.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
Expand Down
7 changes: 3 additions & 4 deletions ps_imageslider.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct()
{
$this->name = 'ps_imageslider';
$this->tab = 'front_office_features';
$this->version = '3.2.0';
$this->version = '3.2.1';
$this->author = 'PrestaShop';
$this->need_instance = 0;
$this->secure_key = Tools::hash($this->name);
Expand Down Expand Up @@ -666,12 +666,11 @@ public function headerHTML()
new Sortable(slideList[0], {
animation: 150,
onUpdate: function (event) {
var sortableIdsAsTableString = this.toArray();
var sortableIdsAsData = sortableIdsAsTableString.map((x) => x.slice(-1));
var slideIdList = this.toArray();
var ajaxCallParameters = {
ajax: true,
action: "updateSlidesPosition",
slides: sortableIdsAsData
slides: slideIdList
};
$.ajax({
type: "POST",
Expand Down
2 changes: 1 addition & 1 deletion views/templates/hook/list.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<div id="slidesContent">
<div id="slides" class="list-group">
{foreach from=$slides item=slide}
<div id="slides_{$slide.id_slide}" class="panel list-group-item" data-id="slides[]={$slide.id_slide}">
<div id="slides_{$slide.id_slide}" class="panel list-group-item" data-id="{$slide.id_slide}">
<div class="row">
<div class="col-lg-1">
<span><i class="icon-arrows "></i></span>
Expand Down

0 comments on commit a6f6125

Please sign in to comment.