HubSpot / messenger

Growl-style alerts and messages for your app. #hubspot-open-source
http://github.hubspot.com/messenger/
MIT License
4.03k stars 408 forks source link

Different hideAfter value (or behaviour) depending on the Type #105

Open rtarnec opened 8 years ago

rtarnec commented 8 years ago

Hello,

Is it possible to parameter Messenger in such a way that:

thx

rtarnec commented 8 years ago

FYI, I've solved a part of the requirement by overriding the default hideAfter value in case it is an error:

function showMessengerMsg(message, type) {
    var msgObj = {
        message: message,
        type: type,
        showCloseButton: true,
        id: "myMessengerAlert"
    };
    if (type == "error") {
        msgObj.hideAfter = 180;
    }
    Messenger().post(msgObj);
}