-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add save & continue editing button #635
base: develop
Are you sure you want to change the base?
Add save & continue editing button #635
Conversation
x-data="{ isVisible: false }" | ||
x-init="() => { isVisible = true; setTimeout(() => isVisible = false, 5000) }" | ||
x-show="isVisible" | ||
x-transition:leave="transition ease-in duration-2000" | ||
x-transition:leave-start="opacity-100 transform scale-100" | ||
x-transition:leave-end="opacity-0 transform scale-90" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be done with JS commands? We would like to remove Alpine in the future, so we should prepare for it now and not add more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The best I can do is either this:
<script>
setTimeout(() => {
const infoFlash = document.getElementById("info-flash");
if (infoFlash) {
infoFlash.style.transition = "opacity 2s ease-in";
infoFlash.style.opacity = 0;
setTimeout(() => infoFlash.remove(), 2000);
}
}, 5000);
</script>
in the html in the flash_messages function(not pretty), since there is no assets with js I can't create a hook.
Or something like this:
<div
:if={Phoenix.Flash.get(@flash, :info) && Phoenix.Flash.get(@flash, :info) != ""}
class="alert bg-info text-info-content my-4 text-sm"
id="info-flash"
phx-click-away={JS.hide(to: "#info-flash", transition: {"transition ease-out duration-2000", "opacity-100 transform scale-100", "opacity-0 transform scale-90"})}
>
That removes the msg when a user is using the page again. But that will remove the msg immediately on click-away which might make it disappear to fast.
disabled: [] | ||
disabled: [], | ||
enabled: [ | ||
{Credo.Check.Consistency.UnusedVariableNames, []} | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot do this as this will result in only adding the Credo.Check.Consistency.UnusedVariableNames
check.
❯ mix credo
Checking 51 source files ...
Analysis took 0.06 seconds (0.06s to load, 0.00s running 1 check on 51 files)
Note that the log displays 1 check
only.
The reason is that credo automatically adds all default checks if the enabled
key is not defined. If its there, it will use the configured checks only.
Instead of:
checks: %{
disabled: [],
enabled: [
{Credo.Check.Consistency.UnusedVariableNames, []}
]
}
we can do this
checks: [
{Credo.Check.Consistency.UnusedVariableNames, []}
]
Also added a 5 second visibility on info-flash-msg for better ui-experience.