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