Skip to content
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

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

Open
rtarnec opened this issue Feb 8, 2016 · 1 comment
Open

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

rtarnec opened this issue Feb 8, 2016 · 1 comment

Comments

@rtarnec
Copy link

rtarnec commented Feb 8, 2016

Hello,

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

  • Messages of Type "success" hides after e.g. 10 seconds (you just want to indicate that everything is ok);
  • Messages of Type "error" can only be hidden by clicking on the close button (or other possibility, it hides after e.g. 3 minutes). -> There is an error, you want it to be visible for a longer time and that the user performs an action in order to hide it.

thx

@rtarnec
Copy link
Author

rtarnec commented Feb 27, 2016

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);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant