From f03e0c69995c787ca967abc018cf05396216a8c0 Mon Sep 17 00:00:00 2001 From: Abdullah Ghanem <3bdullah.ghanem@gmail.com> Date: Thu, 28 Mar 2024 05:05:46 +0200 Subject: [PATCH] Update map.blade.php --- .../views/forms/components/map.blade.php | 121 +++++++----------- 1 file changed, 48 insertions(+), 73 deletions(-) diff --git a/resources/views/forms/components/map.blade.php b/resources/views/forms/components/map.blade.php index b31f6fa..7a94e60 100644 --- a/resources/views/forms/components/map.blade.php +++ b/resources/views/forms/components/map.blade.php @@ -10,98 +10,72 @@ $startLat = $getLatitude(); $startLon = $getLongitude(); $zoom = $getZoom(); - $initialHeight = (($rows ?? 2) * 1.5) + 0.75; + $initialHeight = ($rows ?? 2) * 1.5 + 0.75; @endphp - - $hasInlineLabel, - ]) - > + + $hasInlineLabel, + ])> {{ $getLabel() }} - - > - -
+
+ ], + escape: false, + )->class([ + 'block w-full border-none bg-transparent px-3 py-1.5 text-base text-gray-950 placeholder:text-gray-400 focus:ring-0 disabled:text-gray-500 disabled:[-webkit-text-fill-color:theme(colors.gray.500)] disabled:placeholder:[-webkit-text-fill-color:theme(colors.gray.400)] dark:text-white dark:placeholder:text-gray-500 dark:disabled:text-gray-400 dark:disabled:[-webkit-text-fill-color:theme(colors.gray.400)] dark:disabled:placeholder:[-webkit-text-fill-color:theme(colors.gray.500)] sm:text-sm sm:leading-6', + 'resize-none' => $shouldAutosize, + ])->style([ + "height: {$initialHeight}rem" => $shouldAutosize, + ]) }}> - - + + - + @@ -119,7 +93,7 @@ const compare = () => { try { const values = input.value.split(',') - const [lat, lon] = point.getCoordinates() + const [lon, lat] = point.getCoordinates() if (values.length === 2) { const newLat = parseFloat(values[0]) const newLon = parseFloat(values[1]) @@ -132,7 +106,8 @@ } } if (!map.classList.contains('map-done')) { - point = window.traineratwot.GetPointMap('{{ $getId() }}', {{ $startLat }}, {{ $startLon }}, {{ $zoom }}) + point = window.traineratwot.GetPointMap('{{ $getId() }}', {{ $startLat }}, + {{ $startLon }}, {{ $zoom }}) input.addEventListener('input', compare) compare() point.onChange(function(x, y) { @@ -145,13 +120,13 @@ }) reset.addEventListener('click', () => { - input.value = '{{ $startLat }}, {{ $startLon }}' + input.value = '{{ $startLat }}, {{ $startLon }}' input.dispatchEvent(new Event('input')) input.dispatchEvent(new Event('change')) input.dispatchEvent(new Event('blur')) }) if (disabled) { - if (input.value !== '{{ $startLat }}, {{ $startLon }}') { + if (input.value !== '{{ $startLat }}, {{ $startLon }}') { reset.click() compare() }