/** * TERM OF USE "Paginated Featured Products" is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License * * @author Orange35 * @copyright 2007-2015 Orange35 * @license http://creativecommons.org/licenses/by-nc-sa/3.0/ */ $(document).ready(function(){ App_Paginate.hidePreLoader(); App_Paginate.initButtons(); }); var App_Paginate = { initButtons: function(){ this.initButton('pagination_previous'); this.initButton('pagination_next'); this.initButton('pagination_page'); }, initButton: function(startId){ var obj = this; var startIdSelector = '[id^="' + startId + '"]'; $(startIdSelector + ' a').click(function(e){ e.preventDefault(); obj.showPreLoader(); var query = $.ajax({ type: 'POST', url: 'modules/homefeaturedpaginated/ajax.php', data: 'method=paginate&p=' + $(this).parent().data('page'), dataType: 'json', success: function(data) { if ('undefined' != data && null != data && 'undefined' != typeof data.content) { $('#homefeaturedpaginated').replaceWith(data.content); $('#homefeaturedpaginated').addClass('active'); } obj.initButtons(); }, complete: function() { obj.hidePreLoader(); } }); return false; }); }, showPreLoader: function() { $('#homefeaturedpaginated_loader').show(); }, hidePreLoader: function() { $('#homefeaturedpaginated_loader').hide(); } };