Sha256: 564cdc1e3f517ec755af8ad7ca5c154b3f1571b93263efe5d0ff921d22b0e7f0

Contents?: true

Size: 808 Bytes

Versions: 9

Compression:

Stored size: 808 Bytes

Contents

// Pagination links
// $('#page_element').pagination('.pagination a');
// $('#page_element').bind('pageLoaded', function() {});
// Written by Daniel Mendler
(function($) {
    "use strict";

    $.fn.pagination = function(links) {
	var page = this;

	function loadPage(url) {
            page.load(url + (url.indexOf('?') < 0 ? '?' : '&') + 'no_layout=1', function() {
		page.trigger('pageLoaded', [url]);
            });
	}

	$(document).on('click', links, function() {
            $(this).addClass('loading');
	    if (History.enabled) {
		History.pushState(null, document.title, this.href);
	    } else {
		loadPage(this.href);
	    }
            return false;
        });

	$(window).bind('statechange', function() {
	    var state = History.getState();
	    loadPage(state.url);
	});
    };
})(jQuery);

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
olelo-0.9.15 static/script/13-olelo.pagination.js
olelo-0.9.14 static/script/13-olelo.pagination.js
olelo-0.9.13 static/script/13-olelo.pagination.js
olelo-0.9.12 static/script/13-olelo.pagination.js
olelo-0.9.11 static/script/13-olelo.pagination.js
olelo-0.9.10 static/script/13-olelo.pagination.js
olelo-0.9.9 static/script/13-olelo.pagination.js
olelo-0.9.8 static/script/13-olelo.pagination.js
olelo-0.9.7 static/script/13-olelo.pagination.js