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

Ability to close message manually? #93

Closed
sistemanick opened this issue Jun 16, 2015 · 5 comments
Closed

Ability to close message manually? #93

sistemanick opened this issue Jun 16, 2015 · 5 comments

Comments

@sistemanick
Copy link

Is it possible to close messages manually? For e.g.

msg = growl.info('Hello...');
msg.destroy();
@flippinjoe
Copy link
Collaborator

Hmm. Currently this is doable by

msg = growl.info('Hello...');

growlMessages.deleteMessage(msg);

However, it might be nice to have a more direct approach that you've got above.

@sistemanick
Copy link
Author

@flippinjoe21 Thanks. I tried your suggestion but getting "cannot read property 'messages'" error.

I've set up a plunk here: http://plnkr.co/edit/1HqDTKl6cj5Yrqp7TDT5?p=preview

@callicles
Copy link

Another cool thing would be to enable cleaning up all current growls with something like growl.dismissAll()

The use case: I change state from the login state to the home state. I failed to enter the right password once before the change state so I have a growl saying that my password of login in incorrect. Once I enter correctly my password and get to the home state, I want to clean all error growls that might be displayed.

@flippinjoe
Copy link
Collaborator

So after taking a more in depth look. I've found that both of these are already in there.

For a single message you can destroy manually by

var msg = growl.info('blah');
msg.destroy();

For multi-messages you can do

growlMessages.destroyAllMessages();

There was a potential issue around this not working if you did not have <div growl> linked into your linked into your html yet. But I believe that is now resolved in the latest v0.7.5.

Closing for now

@sistemanick
Copy link
Author

Thanks 0.7.5 fixed it.

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

3 participants