Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

feat(alert): Auto-dismissable alerts #2399

Closed
wants to merge 1 commit into from
Closed

feat(alert): Auto-dismissable alerts #2399

wants to merge 1 commit into from

Conversation

trash
Copy link
Contributor

@trash trash commented Jun 27, 2014

A feature I always like having with alerts is having them optionally be able to disappear after a short time if they're not important.

Lemme know if I'm missing anything in this PR.

@ghost
Copy link

ghost commented Jun 27, 2014

I like this addition. I think a default timeout value would be great. This allows to:

  • omit the timeout value when using the auto-dismiss option
  • configure the timeout value in place in you app

@porjo
Copy link

porjo commented Oct 16, 2014

+1

@pkozlowski-opensource
Copy link
Member

@khalilravanna Thnx for this PR. I think that several people expressed interest in a similar feature. Having said this I would ideally see this feature as a separate directive where people could decide a condition upon which an alert is dismissed. With the current proposal closing on timeout is kind of hard-coded without much room for extensibility.

I think what would work great is to have a separate directive that just removes an alert (or any other directive for that matter (!)) after a certain timeout. Such a directive would be highly reusable. I will try to craft a PR with this idea so we can discuss.

@pkozlowski-opensource
Copy link
Member

@khalilravanna @sanjo could you guys please have a look at the alternative proposal in #2854? With this proposal people can write a directive and decide on they own what should be a condition upon which an alert is dismissed. By default it could be a timeout but one could easily imagine listening to route change, some data bound variable to change its value etc. WDYT?

@ghost
Copy link

ghost commented Oct 19, 2014

I like the better reusability and greater flexibility of #2854.

@trash
Copy link
Contributor Author

trash commented Oct 19, 2014

I agree with you both, #2854 looks like a better, more modular/extensible approach.

ulle pushed a commit to ulle/bootstrap that referenced this pull request Oct 22, 2014
@RobJacobs
Copy link
Contributor

@pkozlowski-opensource I had a need for an auto dismiss directive that could be used on any element that leveraged ng-if, ng-show, or ng-hide. Here is what I came up with: plunk. I wish it was a little more robust in that it didn't need a Boolean value on the scope, but it's a start.

@skidvd
Copy link

skidvd commented Nov 13, 2014

Sorry for the basic question, but what version will this be included in? I have 0.11.2 and I do not see the dismissOnTimeout directive there yet.

I am using the following markup:

<alert ng-repeat="alert in getAlerts()" type="{{::alert.type}}" close="closeAlert($index)" dismiss-on-timeout="10">{{::alert.msg}}</alert>

Alerts are visible, but never auto close on timeout. I have to manually close them.

OronNadiv pushed a commit to lanetix/bootstrap that referenced this pull request Nov 18, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants