bert icon indicating copy to clipboard operation
bert copied to clipboard

Manually close alert on click / disable auto hide

Open bcampardou opened this issue 8 years ago • 11 comments

Simply disable the timer when Bert.defaults.hideDelay = -1 for example.

#41 How can I keep bert alert on screen and manually close it?

Edit : with latest commit also fix #23 #37 #13

You can configure all alerts to be manually closed : Bert.defaults.hideDelay = -1

or specify an alert to be manually closed by using :

    Bert.alert({
        message:'Event updated !', 
        type:'success', 
        hideDelay: -1
    });
    Bert.alert({
        message:'Event updated !', 
        type:'success', 
        hideDelay: 3000
    });

or

Bert.alert('Event updated !', 'success', null, null, -1);
Bert.alert('Event updated !', 'success', null, null, 3000);

bcampardou avatar Jul 31 '17 09:07 bcampardou

Hi @BaobabCoder thank you for taking the time to do this :) Going to review now.

themeteorchef avatar Jul 31 '17 13:07 themeteorchef

@BaobabCoder there seems to be an issue with the new this.hideDelay value being introduced.

It's referenced here but never defined anywhere else in the file. This is causing the alert to stay on screen until the user clicks (as expected when passing -1), but if I pass a custom delay value like your example 3000, the alert still displays indefinitely.

Can you take a look at this for me and let me know if I'm missing something? For reference, I used the two example calls in your comment above to test (both the advanced and standard versions).

themeteorchef avatar Jul 31 '17 14:07 themeteorchef

sure ! I'll take a look as soon as possible. I'm sorry my tests passed.

bcampardou avatar Jul 31 '17 20:07 bcampardou

@themeteorchef i've made a mistake. Fixed now :)

bcampardou avatar Aug 19 '17 09:08 bcampardou

How does one close the alert manually? Is it by pressing anywhere on the bert message like normal? Do we or can we have a close button?

bluefangs avatar Sep 01 '17 06:09 bluefangs

@bluefangs just clicking on the Bert closes it at the moment.

cleverbeagle avatar Sep 01 '17 12:09 cleverbeagle

I did not add buttons. The feature "close on click" was already present

bcampardou avatar Sep 04 '17 08:09 bcampardou

Is this repository dead ?

bcampardou avatar Dec 11 '17 14:12 bcampardou

In a brief coma. Bert was poisoned while taking part in an experiment in which he consumed expired tofu for a month straight. He's currently showing signs of life and just recently mumbled "yoga" the other day. We're optimistic of his recovery :)

cleverbeagle avatar Dec 11 '17 14:12 cleverbeagle

We believe in you Bert! You can do it!

maxpdx avatar Jan 26 '18 21:01 maxpdx

@maxpdx 7055470589_af30f6a6c9_z

cleverbeagle avatar Jan 29 '18 14:01 cleverbeagle