mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 14:56:13 -06:00
#2353 admin add fast product
This commit is contained in:
parent
87971c03eb
commit
e7e7b14a84
@ -13,7 +13,7 @@ class SimpleAdvFormHandler
|
|||||||
|
|
||||||
$builder->saveForm();
|
$builder->saveForm();
|
||||||
|
|
||||||
$ad = $builder->getFormEntry();
|
$ad = $advRepository->find($builder->getFormEntryId());
|
||||||
if ($ad->status !== 'approved') {
|
if ($ad->status !== 'approved') {
|
||||||
$ad->approve();
|
$ad->approve();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -100,14 +100,18 @@ function addAppendByData(data_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function deleteImage(id) {
|
function deleteImage(e, id) {
|
||||||
|
e.preventDefault()
|
||||||
|
|
||||||
var key_item = $.inArray(id, uploaded);
|
var key_item = $.inArray(id, uploaded);
|
||||||
uploaded.splice(key_item, 1);
|
uploaded.splice(key_item, 1);
|
||||||
$('input[name="files"]').val(uploaded.join(','))
|
$('input[name="files"]').val(uploaded.join(','))
|
||||||
$('.imageList').find('div[data-id="' + id + '"]').remove()
|
$('.imageList').find('div[data-id="' + id + '"]').remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
function rotateImage(id) {
|
function rotateImage(e, id) {
|
||||||
|
e.preventDefault()
|
||||||
|
|
||||||
var img = $('.ads-box-image[data-id="' + id + '"]').find('img')
|
var img = $('.ads-box-image[data-id="' + id + '"]').find('img')
|
||||||
var img_url = img.attr('src');
|
var img_url = img.attr('src');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -125,9 +129,11 @@ function rotateImage(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Set Main İmage
|
//Set Main Image
|
||||||
function setMain(id) {
|
function setMain(e, id) {
|
||||||
$('.image-eye-' + uploaded[0]).remove();
|
e.preventDefault()
|
||||||
|
|
||||||
|
$('.main-image').remove();
|
||||||
var key_item = $.inArray(id, uploaded);
|
var key_item = $.inArray(id, uploaded);
|
||||||
uploaded.splice(key_item, 1);
|
uploaded.splice(key_item, 1);
|
||||||
uploaded.unshift(id);
|
uploaded.unshift(id);
|
||||||
|
|||||||
@ -60,7 +60,7 @@ class ValueTableBuilder extends TableBuilder
|
|||||||
'class' => 'col-4',
|
'class' => 'col-4',
|
||||||
'attributes' => [
|
'attributes' => [
|
||||||
'id' => 'setimage',
|
'id' => 'setimage',
|
||||||
'onclick' => 'setMain({entry.id})'
|
'onclick' => 'setMain(event, {entry.id})'
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'rotate' => [
|
'rotate' => [
|
||||||
@ -71,8 +71,7 @@ class ValueTableBuilder extends TableBuilder
|
|||||||
'class' => 'col-4',
|
'class' => 'col-4',
|
||||||
'attributes' => [
|
'attributes' => [
|
||||||
'id' => 'setimage',
|
'id' => 'setimage',
|
||||||
// 'data-action' => 'rotate-image',
|
'onclick' => 'rotateImage(event, {entry.id})',
|
||||||
'onclick' => 'rotateImage({entry.id})',
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'deleteImage' => [
|
'deleteImage' => [
|
||||||
@ -82,7 +81,7 @@ class ValueTableBuilder extends TableBuilder
|
|||||||
'text' => '',
|
'text' => '',
|
||||||
'class' => 'col-4 deleteImage',
|
'class' => 'col-4 deleteImage',
|
||||||
'attributes' => [
|
'attributes' => [
|
||||||
'onclick' => 'deleteImage({entry.id})',
|
'onclick' => 'deleteImage(event, {entry.id})',
|
||||||
'id' => 'setimage',
|
'id' => 'setimage',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user