Skip to content

Commit e4bfcd1

Browse files
Fixes #21 by removing extra div containing ng-show which prevented the animations from working.
1 parent 11cbc18 commit e4bfcd1

File tree

10 files changed

+38
-210
lines changed

10 files changed

+38
-210
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,28 @@ myApp.controller('demoCtrl', ['Flash', function(Flash) {
7373
+ warning
7474
+ danger
7575

76-
#### Methods ####
76+
#### Methods
7777
These methods are mostly for internal usage but can be used also from outside.
7878

7979
``` javascript
8080
Flash.dismiss(1);
8181
// Dismiss the flash with id of 1. Id is not the index of flash but instead a value returned by Flash.create()
8282
```
83+
84+
#### Animating
85+
You can animate the flash messages via traditional Angular way by including _ngAnimate_ as a dependency of your application and then defining the CSS transitions for different classes (_ng-enter_, _ng-move_, _ng-leave_) provided by Angular.
86+
87+
Example:
88+
```
89+
.alert.ng-leave {
90+
opacity: 1;
91+
transition: opacity 1.5s ease-out;
92+
}
93+
.alert.ng-leave-active {
94+
opacity: 0;
95+
}
96+
```
97+
8398
#### [Guidelines for contributors](https://github.com/sachinchoolur/angular-flash/blob/master/contributing.md)
8499

85100
#### Running tests

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-flash-alert",
3-
"version": "2.2.1",
3+
"version": "2.2.2",
44
"homepage": "https://github.com/sachinchoolur/angular-flash",
55
"authors": [
66
"Sachin N <[email protected]>"

contributing.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ Test that Grunt's CLI and Bower are installed by running `grunt --version`. If t
1313

1414
1. Fork and clone the repo.
1515
1. Run `npm install` to install all build dependencies (including Grunt).
16-
1. Run `grunt` to grunt this project.
16+
1. Run `grunt` to compile the code.
17+
1. Run tests as described on README.md.
1718

1819
Assuming that you don't see anything on red, you're ready to go. Just be sure to run `grunt` after making any changes, to ensure that nothing is broken.
1920

demo/stylesheets/stylesheet.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,3 +550,12 @@ a[disabled] {
550550
.listAddCont .action{
551551
top: 13px;
552552
}
553+
554+
.alert.ng-leave {
555+
opacity: 1;
556+
transition: opacity 1.5s ease-out;
557+
}
558+
559+
.alert.ng-leave-active {
560+
opacity: 0;
561+
}

dist/angular-flash.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-flash.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-flash.min.css

Lines changed: 1 addition & 129 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/angular-flash.min.js

Lines changed: 2 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-flash-alert",
3-
"version": "2.2.1",
3+
"version": "2.2.3",
44
"description": "Flash message for AngularJS and Bootstrap",
55
"keywords": [
66
"angular-flash",
@@ -20,7 +20,7 @@
2020
"email": "[email protected]",
2121
"url": "https://github.com/sachinchoolur"
2222
},
23-
"contributos": [
23+
"contributors": [
2424
{
2525
"name": "Roope Hakulinen",
2626
"email": "[email protected]",

src/angular-flash.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ app.directive('flashMessage', [
4848
showClose: '=',
4949
onDismiss: '&'
5050
},
51-
template: '<div ng-show="$root.flashes.length > 0"><div role="alert" ng-repeat="flash in $root.flashes track by $index" id="{{flash.config.id}}" class="alert {{flash.config.class}} alert-{{flash.type}} alert-dismissible alertIn alertOut"><div type="button" class="close" ng-show="flash.showClose" close-flash="{{flash.id}}"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></div> <span dynamic="flash.text"></span> </div></div>',
51+
template: '<div role="alert" ng-repeat="flash in $root.flashes track by $index" id="{{flash.config.id}}" class="alert {{flash.config.class}} alert-{{flash.type}} alert-dismissible alertIn alertOut"><div type="button" class="close" ng-show="flash.showClose" close-flash="{{flash.id}}"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></div> <span dynamic="flash.text"></span> </div>',
5252
link: function(scope, ele, attrs) {
5353
Flash.setDefaultTimeout(scope.duration);
5454
Flash.setShowClose(scope.showClose);

0 commit comments

Comments
 (0)