images are positionable
This commit is contained in:
@@ -305,8 +305,6 @@ class Image extends BaseCachedFile implements EventSubscriberInterface
|
|||||||
public function updatePosition(UpdateImagePositionEvent $event)
|
public function updatePosition(UpdateImagePositionEvent $event)
|
||||||
{
|
{
|
||||||
return $this->genericUpdatePosition($event->getQuery(), $event);
|
return $this->genericUpdatePosition($event->getQuery(), $event);
|
||||||
|
|
||||||
$out = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace Thelia\Controller\Admin;
|
|||||||
|
|
||||||
use Propel\Runtime\Exception\PropelException;
|
use Propel\Runtime\Exception\PropelException;
|
||||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||||
use Thelia\Core\Event\UpdatePositionEvent;
|
use Thelia\Core\Event\UpdateImagePositionEvent;
|
||||||
use Thelia\Core\HttpFoundation\Response;
|
use Thelia\Core\HttpFoundation\Response;
|
||||||
use Thelia\Core\Security\Resource\AdminResources;
|
use Thelia\Core\Security\Resource\AdminResources;
|
||||||
use Thelia\Core\Event\Document\DocumentCreateOrUpdateEvent;
|
use Thelia\Core\Event\Document\DocumentCreateOrUpdateEvent;
|
||||||
@@ -615,9 +615,10 @@ class FileController extends BaseAdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Feed event
|
// Feed event
|
||||||
$imageUpdatePositionEvent = new UpdatePositionEvent(
|
$imageUpdateImagePositionEvent = new UpdateImagePositionEvent(
|
||||||
|
$fileManager->getImageModelQuery($parentType),
|
||||||
$imageId,
|
$imageId,
|
||||||
UpdatePositionEvent::POSITION_ABSOLUTE,
|
UpdateImagePositionEvent::POSITION_ABSOLUTE,
|
||||||
$position
|
$position
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -625,7 +626,7 @@ class FileController extends BaseAdminController
|
|||||||
try {
|
try {
|
||||||
$this->dispatch(
|
$this->dispatch(
|
||||||
TheliaEvents::IMAGE_UPDATE_POSITION,
|
TheliaEvents::IMAGE_UPDATE_POSITION,
|
||||||
$imageUpdatePositionEvent
|
$imageUpdateImagePositionEvent
|
||||||
);
|
);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ use Propel\Runtime\Connection\ConnectionInterface;
|
|||||||
|
|
||||||
class CategoryImage extends BaseCategoryImage
|
class CategoryImage extends BaseCategoryImage
|
||||||
{
|
{
|
||||||
|
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
|
||||||
use \Thelia\Model\Tools\PositionManagementTrait;
|
use \Thelia\Model\Tools\PositionManagementTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use Propel\Runtime\Connection\ConnectionInterface;
|
|||||||
|
|
||||||
class ContentImage extends BaseContentImage
|
class ContentImage extends BaseContentImage
|
||||||
{
|
{
|
||||||
|
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
|
||||||
use \Thelia\Model\Tools\PositionManagementTrait;
|
use \Thelia\Model\Tools\PositionManagementTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use Propel\Runtime\Connection\ConnectionInterface;
|
|||||||
|
|
||||||
class FolderImage extends BaseFolderImage
|
class FolderImage extends BaseFolderImage
|
||||||
{
|
{
|
||||||
|
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
|
||||||
use \Thelia\Model\Tools\PositionManagementTrait;
|
use \Thelia\Model\Tools\PositionManagementTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use Propel\Runtime\Connection\ConnectionInterface;
|
|||||||
|
|
||||||
class ProductImage extends BaseProductImage
|
class ProductImage extends BaseProductImage
|
||||||
{
|
{
|
||||||
|
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
|
||||||
use \Thelia\Model\Tools\PositionManagementTrait;
|
use \Thelia\Model\Tools\PositionManagementTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -126,8 +126,6 @@ $(function($){
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
stop: function( event, ui ) {
|
stop: function( event, ui ) {
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
/* update */
|
/* update */
|
||||||
var newPosition = ui.item.find('.js-sorted-position').html();
|
var newPosition = ui.item.find('.js-sorted-position').html();
|
||||||
var imageId = ui.item.data('sort-id');
|
var imageId = ui.item.data('sort-id');
|
||||||
|
|||||||
Reference in New Issue
Block a user