File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,14 @@ const controlSearchResults = async function () {
5151  } 
5252} ; 
5353
54+ const  controlPagination  =  function  ( )  { 
55+   console . log ( 'Pag controller' ) ; 
56+ } ; 
57+ 
5458const  init  =  function  ( )  { 
5559  recipeView . addHandlerRender ( controlRecipes ) ; 
5660  searchView . addHandlerSearch ( controlSearchResults ) ; 
61+   paginationView . addHandlerClick ( controlPagination ) ; 
5762} ; 
5863
5964init ( ) ; 
Original file line number Diff line number Diff line change @@ -5,6 +5,14 @@ import icons from 'url:../../img/icons.svg';
55class  PaginationView  extends  View  { 
66  _parentElement  =  document . querySelector ( '.pagination' ) ; 
77
8+   addHandlerClick ( handler )  { 
9+     this . _parentElement . addEventListener ( 'click' ,  function  ( e )  { 
10+       const  btn  =  e . target . closest ( '.btn--inline' ) ; 
11+       console . log ( btn ) ; 
12+       handler ( ) ; 
13+     } ) ; 
14+   } 
15+ 
816  _generateMarkup ( )  { 
917    const  curPage  =  this . _data . page ; 
1018    // calculate how many pages we need 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments