From 0f2feed59f0aca48863bb3780ff2452e7e0370d1 Mon Sep 17 00:00:00 2001 From: marina Date: Tue, 28 Jan 2025 13:28:25 +0300 Subject: [PATCH] =?utf8?q?ERP-282=20=D0=9D=D1=83=D0=B6=D0=BD=D0=BE=20?= =?utf8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D1=82=D1=8C=20=D0=B8=D0=BD=D1=82?= =?utf8?q?=D0=B5=D1=80=D1=84=D0=B5=D0=B9=D1=81=20=D0=BD=D0=B0=D1=81=D1=82?= =?utf8?q?=D1=80=D0=BE=D0=B9=D0=BA=D0=B8=20=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7?= =?utf8?q?=D0=B8=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/views/city-store-params/index.php | 8 ++++---- erp24/web/js/city-store-params/city-store-params.js | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/erp24/views/city-store-params/index.php b/erp24/views/city-store-params/index.php index 28f06598..9aaff382 100644 --- a/erp24/views/city-store-params/index.php +++ b/erp24/views/city-store-params/index.php @@ -152,13 +152,13 @@ $this->registerJsFile('/js/city-store-params/city-store-params.js', ['position'
-
- 'btn btn-secondary w-100', 'id' => 'reset-button']); ?> +
+ 'btn btn-primary w-100', 'id' => 'apply-button']); ?>
-
- 'btn btn-primary w-100', 'id' => 'apply-button']); ?> +
+ 'btn btn-secondary w-100', 'id' => 'reset-button']); ?>
diff --git a/erp24/web/js/city-store-params/city-store-params.js b/erp24/web/js/city-store-params/city-store-params.js index a2dedb4d..ed9a0f1b 100644 --- a/erp24/web/js/city-store-params/city-store-params.js +++ b/erp24/web/js/city-store-params/city-store-params.js @@ -135,12 +135,11 @@ $(document).ready(function () { $('#edit-button').click(); } - if ($('.flash-message').hasClass('alert-info') || $('.flash-message').hasClass('alert-success')) { - setTimeout(function () { - $('.flash-message').fadeOut(2000, function() { - $(this).remove(); - }); - }, 15000); + const flashMessage = $('.flash-message'); + + if (flashMessage.length) { + const delayTime = flashMessage.hasClass('alert-success') ? 5000 : 15000; + setTimeout(() => flashMessage.fadeOut(2000, () => flashMessage.remove()), delayTime); } }); @@ -151,4 +150,5 @@ $('#reset-button').on('click', function() { $('#store_type').val(null).trigger('change'); $('#territorial_manager').val(null).trigger('change'); $('#bush_chef_florist').val(null).trigger('change'); + $('#apply-button').click() }); \ No newline at end of file -- 2.39.5