Fixed Left menu livewire event fire issue..
This commit is contained in:
parent
2a9c88bb5d
commit
ced67bded1
@ -28,6 +28,8 @@ class Neww extends Component
|
|||||||
|
|
||||||
foreach($menu->getItems() as $item) {
|
foreach($menu->getItems() as $item) {
|
||||||
if ($this->availableInSearch($item)) {
|
if ($this->availableInSearch($item)) {
|
||||||
|
$this->neww[] = $item;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,6 +37,8 @@ class Settings extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->availableInSearch($item)) {
|
if ($this->availableInSearch($item)) {
|
||||||
|
$this->settings[] = $item;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,23 @@
|
|||||||
<div wire:click.stop id="menu-neww">
|
<div wire:click.stop id="menu-neww" class="relative">
|
||||||
<input type="text" name="neww_keyword" wire:model.debounce.500ms="keyword" placeholder="{{ trans('general.search_placeholder') }}" class="border-t-0 border-l-0 border-r-0 border-b border-gray-300 bg-transparent text-gray-500 text-sm mb-3 focus:outline-none focus:ring-transparent focus:border-purple placeholder-light-gray js-search-action">
|
<input type="text" name="neww_keyword" wire:model.debounce.500ms="keyword" placeholder="{{ trans('general.search_placeholder') }}" class="border-t-0 border-l-0 border-r-0 border-b border-gray-300 bg-transparent text-gray-500 text-sm mb-3 focus:outline-none focus:ring-transparent focus:border-purple placeholder-light-gray js-search-action">
|
||||||
|
|
||||||
{!! menu('neww') !!}
|
@if ($keyword)
|
||||||
</div>
|
<button type="button" class="absolute ltr:right-2 rtl:left-2 top-2 clear" wire:click="resetKeyword">
|
||||||
|
<span class="material-icons text-sm">close</span>
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
|
|
||||||
@push('scripts_end')
|
@if ($neww)
|
||||||
<script type="text/javascript">
|
{!! menu('neww') !!}
|
||||||
window.addEventListener('click', function() {
|
@else
|
||||||
if (Livewire.components.getComponentsByName('menu.neww')[0].data.neww.length > 0) {
|
<ul class="flex flex-col justify-center">
|
||||||
Livewire.emit('resetKeyword');
|
<li class="text-sm mb-5">
|
||||||
}
|
<div class="flex items-start">
|
||||||
});
|
<p class="text-black">
|
||||||
</script>
|
{{ trans('notifications.empty') }}
|
||||||
@endpush
|
</p>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
<div wire:click.stop id="menu-notifications">
|
<div wire:click.stop id="menu-notifications" class="relative">
|
||||||
<input type="text" name="notification_keyword" wire:model.debounce.500ms="keyword" placeholder="{{ trans('general.search_placeholder') }}" class="border-t-0 border-l-0 border-r-0 border-b border-gray-300 bg-transparent text-gray-500 text-sm mb-3 focus:outline-none focus:ring-transparent focus:border-purple placeholder-light-gray js-search-action">
|
<input type="text" name="notification_keyword" wire:model.debounce.500ms="keyword" placeholder="{{ trans('general.search_placeholder') }}" class="border-t-0 border-l-0 border-r-0 border-b border-gray-300 bg-transparent text-gray-500 text-sm mb-3 focus:outline-none focus:ring-transparent focus:border-purple placeholder-light-gray js-search-action">
|
||||||
|
|
||||||
|
@if ($keyword)
|
||||||
|
<button type="button" class="absolute ltr:right-2 rtl:left-2 top-2 clear" wire:click="resetKeyword">
|
||||||
|
<span class="material-icons text-sm">close</span>
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
|
|
||||||
@if ($notifications)
|
@if ($notifications)
|
||||||
<div class="flex justify-end mt-1">
|
<div class="flex justify-end mt-1">
|
||||||
<x-tooltip id="notification-all" placement="right" message="Mark as All Read">
|
<x-tooltip id="notification-all" placement="right" message="Mark as All Read">
|
||||||
@ -53,12 +59,6 @@
|
|||||||
|
|
||||||
@push('scripts_end')
|
@push('scripts_end')
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.addEventListener('click', function() {
|
|
||||||
if (Livewire.components.getComponentsByName('menu.notifications')[0].data.notifications.length > 0) {
|
|
||||||
Livewire.emit('resetKeyword');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
window.addEventListener('mark-read', event => {
|
window.addEventListener('mark-read', event => {
|
||||||
if (event.detail.type == 'notifications') {
|
if (event.detail.type == 'notifications') {
|
||||||
$.notify(event.detail.message, {
|
$.notify(event.detail.message, {
|
||||||
|
@ -1,7 +1,25 @@
|
|||||||
<div wire:click.stop id="menu-settings">
|
<div wire:click.stop id="menu-settings" class="relative">
|
||||||
<input type="text" name="settings_keyword" wire:model.debounce.500ms="keyword" placeholder="{{ trans('general.search_placeholder') }}" class="border-t-0 border-l-0 border-r-0 border-b border-gray-300 bg-transparent text-gray-500 text-sm mb-3 focus:outline-none focus:ring-transparent focus:border-purple placeholder-light-gray js-search-action">
|
<input type="text" name="settings_keyword" wire:model.debounce.500ms="keyword" placeholder="{{ trans('general.search_placeholder') }}" class="border-t-0 border-l-0 border-r-0 border-b border-gray-300 bg-transparent text-gray-500 text-sm mb-3 focus:outline-none focus:ring-transparent focus:border-purple placeholder-light-gray js-search-action">
|
||||||
|
|
||||||
|
@if ($keyword)
|
||||||
|
<button type="button" class="absolute ltr:right-2 rtl:left-2 top-2 clear" wire:click="resetKeyword">
|
||||||
|
<span class="material-icons text-sm">close</span>
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if ($settings)
|
||||||
{!! menu('settings') !!}
|
{!! menu('settings') !!}
|
||||||
|
@else
|
||||||
|
<ul class="flex flex-col justify-center">
|
||||||
|
<li class="text-sm mb-5">
|
||||||
|
<div class="flex items-start">
|
||||||
|
<p class="text-black">
|
||||||
|
{{ trans('notifications.empty') }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@push('scripts_start')
|
@push('scripts_start')
|
||||||
@ -9,13 +27,3 @@
|
|||||||
var is_settings_menu = {{ $active_menu }};
|
var is_settings_menu = {{ $active_menu }};
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
@push('scripts_end')
|
|
||||||
<script type="text/javascript">
|
|
||||||
window.addEventListener('click', function() {
|
|
||||||
if (Livewire.components.getComponentsByName('menu.settings')[0].data.settings.length > 0) {
|
|
||||||
Livewire.emit('resetKeyword');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endpush
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user