| @@ -26,12 +26,12 @@ | ||
| 26 | 26 | isFitWidth: true |
| 27 | 27 | }; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - container.isotope(args); | |
| 30 | + container.isotopewpupg(args); | |
| 31 | 31 | |
| 32 | 32 | container.imagesLoaded( function() { |
| 33 | - container.isotope('layout'); | |
| 33 | + container.isotopewpupg('layout'); | |
| 34 | 34 | }); |
| 35 | 35 | |
| 36 | 36 | WPUltimatePostGrid.grids[grid_id] = { |
| 37 | 37 | args: args, |
| @@ -148,8 +148,9 @@ | ||
| 148 | 148 | var posts = []; |
| 149 | 149 | |
| 150 | 150 | for(var i=0; i < grid.filter_text_posts.length; i++) { |
| 151 | 151 | posts.push('#wpupg-container-post-' + grid.filter_text_posts[i]); |
| 152 | + posts.push('#wpurp-container-recipe-' + grid.filter_text_posts[i]); | |
| 152 | 153 | } |
| 153 | 154 | |
| 154 | 155 | if(posts.length == 0) { |
| 155 | 156 | posts.push('no-result'); |
| @@ -206,9 +207,9 @@ | ||
| 206 | 207 | } |
| 207 | 208 | } |
| 208 | 209 | |
| 209 | 210 | jQuery('#wpupg-grid-' + grid_id + '-empty').hide(); |
| 210 | - grid.container.isotope({ filter: grid.filter }); | |
| 211 | + grid.container.isotopewpupg({ filter: grid.filter }); | |
| 211 | 212 | grid.container.trigger('wpupgFiltered'); |
| 212 | 213 | WPUltimatePostGrid.updateDeeplink(); |
| 213 | 214 | }; |
| 214 | 215 | |
| @@ -358,12 +359,12 @@ | ||
| 358 | 359 | if(filter[0] == 'p') { |
| 359 | 360 | var page = parseInt(filter[1]) - 1; |
| 360 | 361 | WPUltimatePostGrid.updatePagination(jQuery('#wpupg-grid-' + grid_id + '-pagination'), page); |
| 361 | 362 | } else if(filter[0] == 's') { |
| 362 | - WPUltimatePostGrid.updateFilter(jQuery('#wpupg-grid-' + grid_id + '-filter'), filter[0], filter[1]); | |
| 363 | + WPUltimatePostGrid.updateFilter(jQuery('#wpupg-grid-' + grid_id + '-filter'), filter[0], 'text', filter[1]); | |
| 363 | 364 | } else { |
| 364 | 365 | var terms = filter[1].split(','); |
| 365 | - WPUltimatePostGrid.updateFilter(jQuery('#wpupg-grid-' + grid_id + '-filter'), filter[0], terms); | |
| 366 | + WPUltimatePostGrid.updateFilter(jQuery('#wpupg-grid-' + grid_id + '-filter'), filter[0], 'terms', terms); | |
| 366 | 367 | } |
| 367 | 368 | } |
| 368 | 369 | } |
| 369 | 370 | } |
| @@ -399,17 +400,17 @@ | ||
| 399 | 400 | }); |
| 400 | 401 | } |
| 401 | 402 | }; |
| 402 | 403 | |
| 403 | -WPUltimatePostGrid.updateFilter = function(container, taxonomy, terms) { | |
| 404 | - var type = container.data('type'); | |
| 405 | - var func = 'updateFilter' + type.charAt(0).toUpperCase() + type.slice(1); | |
| 404 | +WPUltimatePostGrid.updateFilter = function(container, taxonomy, type, terms) { | |
| 405 | + var filter_type = container.data('type'); | |
| 406 | + var func = 'updateFilter' + filter_type.charAt(0).toUpperCase() + filter_type.slice(1); | |
| 406 | 407 | if(typeof WPUltimatePostGrid[func] == 'function') { |
| 407 | - WPUltimatePostGrid[func](container, taxonomy, terms); | |
| 408 | + WPUltimatePostGrid[func](container, taxonomy, type, terms); | |
| 408 | 409 | } |
| 409 | 410 | }; |
| 410 | 411 | |
| 411 | -WPUltimatePostGrid.updateFilterIsotope = function(container, taxonomy, terms) { | |
| 412 | +WPUltimatePostGrid.updateFilterIsotope = function(container, taxonomy, type, terms) { | |
| 412 | 413 | for(var i = 0; i < terms.length; i++) { |
| 413 | 414 | container.find('.wpupg-filter-tag-' + terms[i]).click(); |
| 414 | 415 | } |
| 415 | 416 | }; |
| @@ -663,18 +664,18 @@ | ||
| 663 | 664 | }); |
| 664 | 665 | }; |
| 665 | 666 | |
| 666 | 667 | WPUltimatePostGrid.insertPosts = function(grid_id, posts) { |
| 667 | - var scrollV = document.documentElement.scrollTop || document.body.scrollTop, | |
| 668 | + var scrollV = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, | |
| 668 | 669 | scrollH = document.documentElement.scrollLeft || document.body.scrollLeft; |
| 669 | 670 | |
| 670 | - WPUltimatePostGrid.grids[grid_id].container.isotope('destroy'); | |
| 671 | + WPUltimatePostGrid.grids[grid_id].container.isotopewpupg('destroy'); | |
| 671 | 672 | |
| 672 | 673 | WPUltimatePostGrid.grids[grid_id].container.append(posts); |
| 673 | - WPUltimatePostGrid.grids[grid_id].container.isotope(WPUltimatePostGrid.grids[grid_id].args); | |
| 674 | + WPUltimatePostGrid.grids[grid_id].container.isotopewpupg(WPUltimatePostGrid.grids[grid_id].args); | |
| 674 | 675 | |
| 675 | 676 | // Restore the scroll offset, should be flicker free |
| 676 | - document.documentElement.scrollTop = document.body.scrollTop = scrollV; | |
| 677 | + jQuery(window).scrollTop(scrollV); | |
| 677 | 678 | document.documentElement.scrollLeft = document.body.scrollLeft = scrollH; |
| 678 | 679 | |
| 679 | 680 | WPUltimatePostGrid.updatePosts(grid_id); |
| 680 | 681 | WPUltimatePostGrid.checkLinks(grid_id); |
| @@ -680,9 +681,9 @@ | ||
| 680 | 681 | WPUltimatePostGrid.checkLinks(grid_id); |
| 681 | 682 | WPUltimatePostGrid.filterGrid(grid_id); |
| 682 | 683 | |
| 683 | 684 | WPUltimatePostGrid.grids[grid_id].container.imagesLoaded( function() { |
| 684 | - WPUltimatePostGrid.grids[grid_id].container.isotope('layout'); | |
| 685 | + WPUltimatePostGrid.grids[grid_id].container.isotopewpupg('layout'); | |
| 685 | 686 | WPUltimatePostGrid.grids[grid_id].loading = false; |
| 686 | 687 | }); |
| 687 | 688 | }; |
| 688 | 689 | |