themeteorchef / bert

A client side, multi-style alerts system for Meteor.
185 stars 27 forks source link

Manually close alert on click / disable auto hide #52

Open bcampardou opened 7 years ago

bcampardou commented 7 years ago

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);
themeteorchef commented 7 years ago

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

themeteorchef commented 7 years ago

@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).

bcampardou commented 7 years ago

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

bcampardou commented 7 years ago

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

bluefangs commented 7 years ago

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?

cleverbeagle commented 7 years ago

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

bcampardou commented 7 years ago

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

bcampardou commented 6 years ago

Is this repository dead ?

cleverbeagle commented 6 years ago

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 :)

maxpdx commented 6 years ago

We believe in you Bert! You can do it!

cleverbeagle commented 6 years ago

@maxpdx 7055470589_af30f6a6c9_z