Skip to content

Commit

Permalink
fix: alpine not loaded x-cloak (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasvinclav committed Jan 10, 2023
1 parent b796519 commit 7e7921f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/unfold/static/unfold/css/styles.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/unfold/templates/unfold/helpers/actions_row.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="group leading-none relative" x-data="{ openActionsId{{ instance.pk }}: false }">
<span class="cursor-pointer material-symbols-outlined md-18 text-gray-400 transition-colors group-hover:text-primary-600 dark:text-gray-400" @click="openActionsId{{ instance.pk }} = !openActionsId{{ instance.pk }}">more_horiz</span>

<nav class="absolute bg-white border flex flex-col leading-none py-1 right-0 rounded-md shadow-lg text-gray-500 text-sm z-50 w-48 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400" x-show="openActionsId{{ instance.pk }}" @click.outside="openActionsId{{ instance.pk }} = false">
<nav class="absolute bg-white border flex flex-col leading-none py-1 right-0 rounded-md shadow-lg text-gray-500 text-sm z-50 w-48 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400" x-cloak x-show="openActionsId{{ instance.pk }}" @click.outside="openActionsId{{ instance.pk }} = false">
{% for action in actions %}
<a href="{{ action.path }}" class="mx-1 px-3 py-2 rounded-md whitespace-nowrap hover:bg-gray-100 dark:hover:bg-gray-700 dark:hover:text-gray-200"{% for attr_name, attr_value in action.attrs.items %} {{ attr_name }}="{{ attr_value }}"{% endfor %}>
{{ action.title }}
Expand Down
4 changes: 2 additions & 2 deletions src/unfold/templates/unfold/helpers/userlinks.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<div class="flex items-center ml-auto">
<div class="flex group items-center relative" x-data="{ openUserLinks: false }">
<div @click="openUserLinks = !openUserLinks">
<div @click="openUserLinks = !openUserLinks">
{% include 'unfold/helpers/avatar.html' with initials=request.user.get_initials|default:'<i class="material-symbols-outlined text-gray-400">person</i>' image=request.user.get_photo %}
</div>

<nav class="absolute bg-white border flex flex-col leading-none overflow-hidden py-1 right-0 rounded shadow-lg text-sm text-gray-500 top-10 w-52 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400" x-show="openUserLinks" @click.outside="openUserLinks = false">
<nav class="absolute bg-white border flex flex-col leading-none overflow-hidden py-1 right-0 rounded shadow-lg text-sm text-gray-500 top-10 w-52 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400" x-cloak x-show="openUserLinks" @click.outside="openUserLinks = false">
<div class="border-b border-gray-100 flex flex-row flex-shrink-0 items-start justify-start mb-1 pb-1 dark:border-gray-700">
<span class="block mx-1 px-3 py-2 truncate">
{% firstof user.get_short_name user.get_username %}
Expand Down
4 changes: 4 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ html {
column-fill: auto;
}

[x-cloak] {
@apply !hidden;
}

@layer utilities {
.border-spacing-none {
border-spacing: 0;
Expand Down

0 comments on commit 7e7921f

Please sign in to comment.