#1175 Watermark admin settings imp.

This commit is contained in:
Diatrex 2020-03-30 17:27:51 +03:00
parent 23bc0b8ec6
commit b95e0c4e9b
3 changed files with 36 additions and 3 deletions

View File

@ -0,0 +1,13 @@
// Hide watermark_image by default
$(".watermark_image").hide();
$("select[name='watermark_type']").change((event) => {
let watermarkType = event.target.value;
if (watermarkType === 'text') {
$(".watermark_image").hide();
$(".watermark_text").show()
} else if (event.target.value === 'image') {
$(".watermark_image").show();
$(".watermark_text").hide()
}
});

View File

@ -3,11 +3,13 @@
use Anomaly\Streams\Platform\Addon\AddonCollection;
use Anomaly\Streams\Platform\Addon\AddonServiceProvider;
use Anomaly\Streams\Platform\Model\Location\LocationVillageEntryModel;
use Anomaly\Streams\Platform\Ui\Table\Event\TableIsQuerying;
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
use Visiosoft\AdvsModule\Adv\AdvRepository;
use Anomaly\Streams\Platform\Model\Advs\AdvsAdvsEntryModel;
use Visiosoft\AdvsModule\Adv\AdvModel;
use Visiosoft\AdvsModule\Adv\Form\AdvFormBuilder;
use Visiosoft\AdvsModule\Listener\AddAdvsSettingsScript;
use Visiosoft\LocationModule\Village\Contract\VillageRepositoryInterface;
use Visiosoft\LocationModule\Village\VillageRepository;
use Visiosoft\LocationModule\Village\VillageModel;
@ -262,9 +264,9 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
* @type array|null
*/
protected $listeners = [
//Visiosoft\AdvsModule\Event\ExampleEvent::class => [
// Visiosoft\AdvsModule\Listener\ExampleListener::class,
//],
TableIsQuerying::class => [
AddAdvsSettingsScript::class,
],
];
/**

View File

@ -0,0 +1,18 @@
<?php namespace Visiosoft\AdvsModule\Listener;
use Anomaly\Streams\Platform\Ui\Table\Event\TableIsQuerying;
class AddAdvsSettingsScript
{
/**
* @param TableIsQuerying $event
*/
public function handle(TableIsQuerying $event)
{
if (pathinfo(request()->url())['basename'] === "visiosoft.module.advs") {
$builder = $event->getBuilder();
$builder->addAsset('scripts.js', 'visiosoft.module.advs::js/settings.js');
}
}
}