(function ($) {
  'use strict';
  if ($.support.pjax) {
    $.pjax.defaults.maxCacheLength = 0;
    var container = $('#view');
    $(document).on('click', 'a[data-pjax], [data-pjax] a, .small-nav a, #pagination li a', function(event) {
      $.pjax.click(event, {
        container: container,
        timeout: 6000,
        fragment: '#view',
        show: 'fade',
        cache: false,
        storage: true
      });
    });

    $(document).on('pjax:start', function() {
      $( document ).trigger( "pjaxStart" );
    });
    // fix js
    $(document).on('pjax:end', function(event) {
      $( document ).trigger( "pjaxEnd" );
    });
  }
})(jQuery);

