| @@ -7,20 +7,31 @@ | ||
| 7 | 7 | * |
| 8 | 8 | * @param pagination_container - '.wpbc_rules_pagination' |
| 9 | 9 | * @param params_obj - JSON object ~ { 'page_active': $page_active, 'pages_count': $pages_count } |
| 10 | 10 | */ |
| 11 | -function wpbc_pagination_echo( pagination_container, params_obj ){ | |
| 11 | +function wpbc_pagination_echo( pagination_container, container_header, container_footer, params_obj ){ | |
| 12 | 12 | |
| 13 | - var pagination = wp.template( 'wpbc_pagination' ); | |
| 14 | - jQuery( pagination_container ).html( '<div class="wpbc-bottom-pagination"></div>' ); | |
| 13 | + // Header: " 1 - 9 of many | < > ". | |
| 14 | + var wpbc_pagination__prev_next = wp.template( 'wpbc_pagination__prev_next' ); | |
| 15 | + jQuery( container_header ).html( wpbc_pagination__prev_next( params_obj ) ); | |
| 15 | 16 | |
| 16 | - // Pagination | |
| 17 | - jQuery( pagination_container + ' .wpbc-bottom-pagination').append( pagination( params_obj ) ) ; | |
| 17 | + // Active page Number in Selectbox | |
| 18 | + var wpbc_pagination_active_page_in_selectbox = wp.template( 'wpbc_pagination_active_page_in_selectbox' ); | |
| 19 | + jQuery( container_footer ).html( wpbc_pagination_active_page_in_selectbox( params_obj ) ); | |
| 18 | 20 | |
| 21 | + // Number of Items / Page. | |
| 22 | + var wpbc_pagination_items_per_page = wp.template( 'wpbc_pagination_items_per_page' ); | |
| 23 | + jQuery( container_footer ).append( wpbc_pagination_items_per_page( params_obj ) ); | |
| 19 | 24 | |
| 20 | - // Number of items per page | |
| 21 | - var pagination_items_per_page = wp.template( 'wpbc_pagination_items_per_page' ); | |
| 22 | - jQuery( pagination_container + ' .wpbc-bottom-pagination').append( pagination_items_per_page( params_obj ) ) ; | |
| 25 | + | |
| 26 | + // | |
| 27 | + // var pagination = wp.template( 'wpbc_pagination' ); | |
| 28 | + // jQuery( pagination_container ).html( '<div class="wpbc-bottom-pagination"></div>' ); | |
| 29 | + // | |
| 30 | + // // Pagination | |
| 31 | + // jQuery( pagination_container + ' .wpbc-bottom-pagination').append( pagination( params_obj ) ) ; | |
| 32 | + | |
| 33 | + | |
| 23 | 34 | |
| 24 | 35 | jQuery( pagination_container ).show(); |
| 25 | 36 | } |
| 26 | 37 | |