File tree Expand file tree Collapse file tree 4 files changed +49
-20
lines changed Expand file tree Collapse file tree 4 files changed +49
-20
lines changed Original file line number Diff line number Diff line change 33        . module ( 'app' ,  [ 'sarsha.spinner' ] ) 
44        . controller ( 'appCtrl' ,  function  ( spinnerService )  { 
55            this . spinner  =  spinnerService ; 
6+             this . data  =  [ ] ; 
7+             initData . bind ( this ) ( ) ; 
68
7-             this . open  =  function  ( name )  { 
8-                 spinnerService . show ( name ) ; 
9-             } 
10- 
11-             this . close  =  function  ( name )  { 
12-                 spinnerService . close ( name ) ; 
9+             function  initData ( )  { 
10+                 for  ( var  i  =  0 ;  i  <  8 ;  i ++ )  { 
11+                     this . data . push ( { 
12+                         title : 'title '  +  i , 
13+                         data : 'data '  +  i , 
14+                         date : new  Date ( ) 
15+                     } ) 
16+                 } 
1317            } 
1418        } ) 
1519} ) ( ) ; 
Original file line number Diff line number Diff line change 1212            margin :  15px   auto;
1313            color :  red;
1414        }
15- 
16-         sarsha-spinner  span {
15+          
16+         sarsha-spinner  span   {
1717            display :  block;
1818        }
19+         
20+         table  {
21+             margin-top :  15px  ;
22+         }
23+ 
24+         table  td {
25+             padding :  10px  ;
26+         }
1927    </ style > 
2028</ head > 
2129
2432        < button  ng-click ="$ctrl.spinner.showAll() "> show all</ button > 
2533        < button  ng-click ="$ctrl.spinner.closeAll() "> close all</ button > 
2634    </ div > 
27-     < button  ng-click ="$ctrl.open('spinner1') "> open 1</ button > 
28-     < button  ng-click ="$ctrl.close('spinner1') "> close 1</ button > 
35+     < div > 
36+         < button  ng-click ="$ctrl.spinner.show('spinner1') "> open 1</ button > 
37+         < button  ng-click ="$ctrl.spinner.close('spinner1') "> close 1</ button > 
38+     </ div > 
2939    < div  class ="content "> 
3040        < div > 
3141            < span > Content 1</ span > 
3545            < span > Whoo hoooo !</ span > 
3646        </ sarsha-spinner > 
3747    </ div > 
38-     < button  ng-click ="$ctrl.open ('spinner2') "> open 2</ button > 
39-     < button  ng-click ="$ctrl.close('spinner2') "> close 2</ button > 
40-     < div   class =" content " > 
48+     < button  ng-click ="$ctrl.spinner.show ('spinner2') "> open 2</ button > 
49+     < button  ng-click ="$ctrl.spinner. close('spinner2') "> close 2</ button > 
50+     < div > 
4151        < sarsha-spinner  name ="spinner2 "> </ sarsha-spinner > 
42-         Content 2
52+         < table > 
53+             < thead > 
54+                 < tr > 
55+                     < th > Title</ th > 
56+                     < th > Data</ th > 
57+                     < th > Date</ th > 
58+                 </ tr > 
59+             </ thead > 
60+             < tbody > 
61+                 < tr  ng-repeat ="row in $ctrl.data "> 
62+                     < td > {{row.title}}</ td > 
63+                     < td > {{row.data}}</ td > 
64+                     < td > {{row.date | date}}</ td > 
65+                 </ tr > 
66+             </ tbody > 
67+         </ table > 
4368    </ div > 
4469    < script  src ="../node_modules/angular/angular.js "> </ script > 
4570    < script  src ="../node_modules/angular-animate/angular-animate.min.js "> </ script > 
Original file line number Diff line number Diff line change 44    bottom :  0 ;
55    left :  0 ;
66    right :  0 ;
7-     background :  rgba (227 ,  223 ,  223 ,  0.47  );
7+     background :  rgba (227 ,  223 ,  223 ,  0.67  );
88    z-index :  99999 ;
99    color :  white; 
1010    text-align :  center;
4040}
4141
4242.spinner  >  div  {
43-   background-color :  # 333 
43+   background-color :  # 6795b4 
4444  height :  100%  ;
4545  width :  6px  ;
4646  display :  inline-block;
Original file line number Diff line number Diff line change 3131                var  parent  =  elm . parent ( ) ; 
3232                var  parentPosition  =  parent . position ; 
3333
34-                 var  spinnerScope  =  { 
34+                 var  spinnerContext  =  { 
3535                    show : show , 
3636                    close : close 
3737                } 
4747                    scope . active  =  false ; 
4848                } 
4949
50-                 spinnerService . register ( scope . name ,  spinnerScope ) ; 
50+                 spinnerService . register ( scope . name ,  spinnerContext ) ; 
5151            } 
5252        } 
5353    } 
8989            } 
9090        } 
9191
92-         function  register ( name ,  spinnerScope )  { 
93-             spinners [ name ]  =  spinnerScope ; 
92+         function  register ( name ,  spinnerContext )  { 
93+             spinners [ name ]  =  spinnerContext ; 
9494        } 
9595
9696        function  unregister ( name )  { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments