Is there a way to close a pop up from an action of a user defined button? #1101
Unanswered
marcuscps
asked this question in
Questions about config, custom styles and templates
Replies: 1 comment 3 replies
-
Add this to every buttons custom style: .bubble-action{
cursor: pointer !important;
}
${(() => {
if(!card.extraListenerAdded){
card.querySelector('.bubble-action').addEventListener('click', () => {
if (!location.hash) return;
setTimeout(() => {
const newURL = window.location.href.split('#')[0];
history.replaceState(null, "", newURL);
window.dispatchEvent(new Event('location-changed'));
}, 50);
})
card.extraListenerAdded = true;
}
})()} If this solves your problem, mark this as the answer and close the discussion. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TLDF: Is there an action to close the currently active pop-up? (just like the X button on the top, but from a user defined button inside the pop-up.
Context:
I have a button in my dashboard to open a skylight for 30 minutes.
If I long press it, it open a pop-up that allows opening if for a longer/shorter time:
I'd like to close the pop-up whenever one of the buttons are clicked, but couldn't find a way to do so.
Is it something supported?
I have a hacky solution for invoking multiple actions from a single tap_action. This way I can invoke the script to open the skylight. A second action would be closing the pop-up, I just don't know how to do it.
Thanks a lot.
Beta Was this translation helpful? Give feedback.
All reactions