1
- /*! angular-flash - v2.2.4 - 2016-03-05
1
+ /*! angular-flash - v2.2.5 - 2016-03-17
2
2
* https://github.com/sachinchoolur/angular-flash
3
3
* Copyright (c) 2016 Sachin; Licensed MIT */
4
- "use strict" ; var app = angular . module ( "ngFlash" , [ ] ) ; app . run ( [ "$rootScope" , function ( a ) { return a . flashes = [ ] } ] ) , app . directive ( "dynamic" , [ "$compile" , function ( a ) { return { restrict :"A" , replace :! 0 , link :function ( b , c , d ) { return b . $watch ( d . dynamic , function ( d ) { return c . html ( d ) , a ( c . contents ( ) ) ( b ) } ) } } } ] ) , app . directive ( "closeFlash" , [ "$compile" , "$rootScope" , "Flash" , function ( a , b , c ) { return { link :function ( a , d , e ) { return d . on ( "click" , function ( ) { var a = parseInt ( e . closeFlash , 10 ) ; c . dismiss ( a ) , b . $apply ( ) } ) } } } ] ) , app . directive ( "flashMessage" , [ "Flash" , function ( a ) { return { restrict :"E" , scope :{ duration :"=" , showClose :"=" , onDismiss :"&" } , 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">×</span><span class="sr-only">Close</span></div> <span dynamic="flash.text"></span> </div>' , link :function ( b , c , d ) { function e ( a ) { "function" == typeof b . onDismiss && b . onDismiss ( { flash :a } ) } a . setDefaultTimeout ( b . duration ) , a . setShowClose ( b . showClose ) , a . setOnDismiss ( e ) } } } ] ) , app . factory ( "Flash" , [ "$rootScope" , "$timeout" , function ( a , b ) { function c ( b ) { return a . flashes . findIndex ( function ( a ) { return a . id === b } ) } var d = { } , e = 0 ; return d . setDefaultTimeout = function ( a ) { "number" == typeof a && ( d . defaultTimeout = a ) } , d . defaultShowClose = ! 0 , d . setShowClose = function ( a ) { "boolean" == typeof a && ( d . defaultShowClose = a ) } , d . setOnDismiss = function ( a ) { "function" == typeof a && ( d . onDismiss = a ) } , d . create = function ( c , f , g , h , i ) { var j = void 0 , k = void 0 ; return j = this , k = { type :c , text :f , config :h , id :e ++ } , k . showClose = "undefined" != typeof i ?i :d . defaultShowClose , d . defaultTimeout && "undefined" == typeof g ?k . timeout = d . defaultTimeout :g && ( k . timeout = g ) , a . flashes . push ( k ) , k . timeout && ( k . timeoutObj = b ( function ( ) { j . dismiss ( k . id ) } , k . timeout ) ) , k . id } , d . pause = function ( c ) { a . flashes [ c ] . timeoutObj && b . cancel ( a . flashes [ c ] . timeoutObj ) } , d . dismiss = function ( b ) { var e = c ( b ) ; if ( - 1 !== e ) { var f = a . flashes [ e ] ; d . pause ( e ) , a . flashes . splice ( e , 1 ) , a . $digest ( ) , "function" == typeof d . onDismiss && d . onDismiss ( f ) } } , d . clear = function ( ) { for ( ; a . flashes . length > 0 ; ) d . dismiss ( a . flashes [ 0 ] . id ) } , d . reset = d . clear , d } ] ) ;
4
+
5
+ /*! angular-flash - v2.2.5 - 2016-03-17
6
+ * https://github.com/sachinchoolur/angular-flash
7
+ * Copyright (c) 2016 Sachin; Licensed MIT */
8
+ "use strict" ;
9
+ var app = angular . module ( "ngFlash" , [ ] ) ;
10
+ app . run ( [ "$rootScope" , function ( a ) {
11
+ return a . flashes = [ ]
12
+ } ] ) , app . directive ( "dynamic" , [ "$compile" , function ( a ) {
13
+ return {
14
+ restrict : "A" , replace : ! 0 , link : function ( b , c , d ) {
15
+ return b . $watch ( d . dynamic , function ( d ) {
16
+ return c . html ( d ) , a ( c . contents ( ) ) ( b )
17
+ } )
18
+ }
19
+ }
20
+ } ] ) , app . directive ( "closeFlash" , [ "$compile" , "$rootScope" , "Flash" , function ( a , b , c ) {
21
+ return {
22
+ link : function ( a , d , e ) {
23
+ return d . on ( "click" , function ( ) {
24
+ var a = parseInt ( e . closeFlash , 10 ) ;
25
+ c . dismiss ( a ) , b . $apply ( )
26
+ } )
27
+ }
28
+ }
29
+ } ] ) , app . directive ( "flashMessage" , [ "Flash" , function ( a ) {
30
+ return {
31
+ restrict : "E" ,
32
+ scope : { duration : "=" , showClose : "=" , onDismiss : "&" } ,
33
+ 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">×</span><span class="sr-only">Close</span></div> <span dynamic="flash.text"></span> </div>' ,
34
+ link : function ( b , c , d ) {
35
+ function e ( a ) {
36
+ "function" == typeof b . onDismiss && b . onDismiss ( { flash : a } )
37
+ }
38
+
39
+ a . setDefaultTimeout ( b . duration ) , a . setShowClose ( b . showClose ) , a . setOnDismiss ( e )
40
+ }
41
+ }
42
+ } ] ) , app . factory ( "Flash" , [ "$rootScope" , "$timeout" , function ( a , b ) {
43
+ function c ( b ) {
44
+ return a . flashes . map ( function ( a ) {
45
+ return a . id
46
+ } ) . indexOf ( b )
47
+ }
48
+
49
+ var d = { } , e = 0 ;
50
+ return d . setDefaultTimeout = function ( a ) {
51
+ "number" == typeof a && ( d . defaultTimeout = a )
52
+ } , d . defaultShowClose = ! 0 , d . setShowClose = function ( a ) {
53
+ "boolean" == typeof a && ( d . defaultShowClose = a )
54
+ } , d . setOnDismiss = function ( a ) {
55
+ "function" == typeof a && ( d . onDismiss = a )
56
+ } , d . create = function ( c , f , g , h , i ) {
57
+ var j = void 0 , k = void 0 ;
58
+ return j = this , k = {
59
+ type : c ,
60
+ text : f ,
61
+ config : h ,
62
+ id : e ++
63
+ } , k . showClose = "undefined" != typeof i ? i : d . defaultShowClose , d . defaultTimeout && "undefined" == typeof g ? k . timeout = d . defaultTimeout : g && ( k . timeout = g ) , a . flashes . push ( k ) , k . timeout && ( k . timeoutObj = b ( function ( ) {
64
+ j . dismiss ( k . id )
65
+ } , k . timeout ) ) , k . id
66
+ } , d . pause = function ( c ) {
67
+ a . flashes [ c ] . timeoutObj && b . cancel ( a . flashes [ c ] . timeoutObj )
68
+ } , d . dismiss = function ( b ) {
69
+ var e = c ( b ) ;
70
+ if ( - 1 !== e ) {
71
+ var f = a . flashes [ e ] ;
72
+ d . pause ( e ) , a . flashes . splice ( e , 1 ) , a . $digest ( ) , "function" == typeof d . onDismiss && d . onDismiss ( f )
73
+ }
74
+ } , d . clear = function ( ) {
75
+ for ( ; a . flashes . length > 0 ; ) d . dismiss ( a . flashes [ 0 ] . id )
76
+ } , d . reset = d . clear , d
77
+ } ] ) ;
0 commit comments