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