From b742ee013d795737cf28be7956f2e522a3102b76 Mon Sep 17 00:00:00 2001 From: Burak Civan Date: Mon, 27 Jun 2022 14:27:11 +0300 Subject: [PATCH] code refactoring --- public/akaunting-js/generalAction.js | 8 +++++--- .../layouts/modules/show/buttons.blade.php | 14 +++++++------- .../views/components/link/loading.blade.php | 18 ++++++++++-------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/public/akaunting-js/generalAction.js b/public/akaunting-js/generalAction.js index ae3b9f0ef..3b5dc3b2c 100644 --- a/public/akaunting-js/generalAction.js +++ b/public/akaunting-js/generalAction.js @@ -293,10 +293,12 @@ function OnInput() { //Auto Height for Textarea //Loading scenario for href links -document.querySelectorAll('[data-link]').forEach((href) => { - href.addEventListener('click', function () { +document.querySelectorAll('[data-link-loading]').forEach((href) => { + let target_link_html = href.parentElement; + + target_link_html.addEventListener('click', function () { this.classList.add('disabled-link'); - this.querySelector('[data-link-loading]').classList.remove('hidden'); + this.querySelector('[data-link-spin]').classList.remove('hidden'); this.querySelector('[data-link-text]').classList.add('opacity-0'); this.querySelector('[data-link-text]').classList.remove('opacity-1'); }); diff --git a/resources/views/components/layouts/modules/show/buttons.blade.php b/resources/views/components/layouts/modules/show/buttons.blade.php index fd755ede6..c8c5ac5a5 100644 --- a/resources/views/components/layouts/modules/show/buttons.blade.php +++ b/resources/views/components/layouts/modules/show/buttons.blade.php @@ -1,7 +1,7 @@ @props(['module', 'installed', 'enable']) @if (! empty($module->plan)) - + {{ trans('modules.get_premium_cloud') }} @@ -9,7 +9,7 @@ @elseif (in_array('onprime', $module->where_to_use)) @if ($installed) @can('delete-modules-item') - + {{ trans('modules.button.uninstall') }} @@ -18,13 +18,13 @@ @can('update-modules-item') @if ($enable) - + {{ trans('modules.button.disable') }} @else - + {{ trans('modules.button.enable') }} @@ -53,7 +53,7 @@ @endif @else - + {{ trans('modules.use_app') }} @@ -63,13 +63,13 @@ @endif @else @if ($module->install) - + {{ trans('modules.install_cloud') }} @else - + {{ trans('modules.get_cloud') }} diff --git a/resources/views/components/link/loading.blade.php b/resources/views/components/link/loading.blade.php index ea72d1152..06b698485 100644 --- a/resources/views/components/link/loading.blade.php +++ b/resources/views/components/link/loading.blade.php @@ -1,9 +1,11 @@ - +
+ - - {!! $slot !!} - \ No newline at end of file + + {!! $slot !!} + +
\ No newline at end of file