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

Programmatically destroy messages & allow disabling click to close #38

Merged
merged 21 commits into from
Sep 20, 2014

Conversation

chasemgray
Copy link

#37

@chasemgray
Copy link
Author

I'm only using this for a subset of the features you support so I didn't get to check against all your demos.

@JanStevens
Copy link
Owner

Hello,

Thanks for your contribution, you changed a lot (extracting message service). I'll need some time to review it and test it against all the features we currently support. (Don't want to brake anything). But looks good! Can you list the features you already checked?

Regards

@chasemgray
Copy link
Author

I can check some more of the examples you have online.

For my site I checked:

  • growl alerts display in the right position
  • They are closable
  • Closing can be disabled now
  • setText updates the text for the message and escapes HTML
  • The message is returned from each of the info, success, etc. calls
  • The TTL still works
  • The stacking still works, and also works when combined with editing one of the displayed messages
  • Destroying a message programmatically works.
  • Disabling icons
  • Animations

I added:

  • closeToClick option flag per message
  • when deleting a message I added the 'close' flag, similar to the timeout removal, to the message so it can be used to know that the message has been closed
  • Added setText to each message to update its content, which escapes with $sce
  • Moved the message service out to a service so we can return the added messages
  • Added a destroy method to each of the messages so they can be programatically destroyed.

@chasemgray
Copy link
Author

I checked all the codepen examples and the only thing not working is the reference ID. Not sure exactly why yet.

@chasemgray
Copy link
Author

fixed references

@JanStevens
Copy link
Owner

Allright, looks great, when I have time this week I'll go through it and merge it, thanks!

@jgoux
Copy link

jgoux commented Sep 13, 2014

Exactly the PR I needed ! Thanks a lot @chasemgray ! 👍

@wkjesus
Copy link

wkjesus commented Sep 19, 2014

with this features, how can i destroy an a particular notification programatically...???
exm:
growl.warning("This adds a warn message", {title: 'Warning!'});
//so how can i destroy this when user do something else...

i hope answer and thanks by the way..

@chasemgray
Copy link
Author

it now returns the message object which has a destroy method.

On Fri, Sep 19, 2014 at 11:55 AM, Jesus Adan Carrasco roman <
[email protected]> wrote:

with this features, how can i destroy an a particular notification
programatically...???
exm:
growl.warning("This adds a warn message", {title: 'Warning!'});
//so how can i destroy this when user do something else...

i hope answer and thanks by the way..


Reply to this email directly or view it on GitHub
#38 (comment)
.

@wkjesus
Copy link

wkjesus commented Sep 19, 2014

sorry, i can figure out.. i do a console.log(growl); but dont see, how call that method i dont know if you have an example.. pls. i am doing something like this :

$scope.addSpecialWarnMessage = function() {
console.log("mensajes");
growl.warning("This adds a warn message", {title: 'Warning!'});
growl.info("This adds a info message", {title: 'Random Information'});
growl.success("This adds a success message"); //no title here
growl.error("This adds a error message", {title: 'ALERT WE GOT ERROR'});

    $timeout(function(){
        console.log(growl);
    },100);
}

i nee to know how destroy for example the growl.warning, or what ever growl, ill appreciate your help. thx.. by the way and for a quickly reply.

@chasemgray
Copy link
Author

var message = growl.info("This adds a info message", {title: 'Random
Information'});
message.destroy();

On Fri, Sep 19, 2014 at 1:07 PM, Jesus Adan Carrasco roman <
[email protected]> wrote:

sorry, i can figure out.. i do a console.log(growl); but dont see, how
call that method i dont know if you have an example.. pls. i am doing
something like this :

$scope.addSpecialWarnMessage = function() {
console.log("mensajes");
growl.warning("This adds a warn message", {title: 'Warning!'});
growl.info("This adds a info message", {title: 'Random Information'});
growl.success("This adds a success message"); //no title here
growl.error("This adds a error message", {title: 'ALERT WE GOT ERROR'});

$timeout(function(){
    console.log(growl);
},100);

}

i nee to know how destroy for example the growl.warning, or what ever
growl, ill appreciate your help. thx.. by the way and for a quickly reply.


Reply to this email directly or view it on GitHub
#38 (comment)
.

@wkjesus
Copy link

wkjesus commented Sep 19, 2014

Te la rifaste!!!!! ......( translate to english... its something like ... you are awesome.. lol.. )
thx for your time to reply, that is what im looking for..... now all clear... by the way when do you think your fork will merge???...

JanStevens added a commit that referenced this pull request Sep 20, 2014
Programmatically destroy messages & allow disabling click to close
@JanStevens JanStevens merged commit 00af027 into JanStevens:master Sep 20, 2014
@m4r71n
Copy link

m4r71n commented Sep 24, 2014

Thank you very much @chasemgray!

@valera-rozuvan
Copy link

@chasemgray If you need the original https://github.com/marcorinck/angular-growl plus the functionality to programmatically destroy all messages, please check out https://github.com/valera-rozuvan/angular-growl-next . Release 0.4.2 of angular-growl-next makes available the method clearAll().

@fgarci03
Copy link

It is still not possible to disable clickToClose even without the closing button (by clicking twice on the message itself). Is there a fix for this?

@danemacaulay
Copy link

+1 for message.destroy()
thanks for adding this PR 💃

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

Successfully merging this pull request may close these issues.

8 participants