Skip to content

Instantly share code, notes, and snippets.

@mohit-rocks
mohit-rocks / infinitescrollajax.js
Created October 11, 2014 14:07
Infinite pager without infinitescroll.js [Drupal] [Apache solr page] Ref : https://www.drupal.org/node/1473558#comment-8597229
/**
* Js file to add load more button on the search result page.
*/
(function ($) {
Drupal.behaviors.loadMoreAjax = {
attach: function (context, settings) {
$('.load-more-ajax', context).click(function () {
var nextPage = $('.pager .pager__item--next a').attr('href');
var lastPage = $('.pager .pager__item--last a').attr('href');
@mohit-rocks
mohit-rocks / date-views-pager.tpl.php
Created February 11, 2014 04:55
override the pager title for the calendar(Drupal 7)
<?php
/**
* @file
* Template file for the example display.
*
* Variables available:
*
* $plugin: The pager plugin object. This contains the view.
*
* $plugin->view
@mohit-rocks
mohit-rocks / infinitescroll.js
Last active December 17, 2015 19:29
Infinite scroll.js file for the infinite scroll of the page.
(function($){
Drupal.behaviors.viewsInfiniteScroll = {
attach: function (context, settings) {
$(function(){
if (this.processed) return;
this.processed=true;
if ($('.search-results').length==0) return;
var $container = $('.search-results');
$container.imagesLoaded( function(){
$container.infinitescroll({