Sha256: 376dfac0b6603fab807e56a5fd595532d0f58cc6c7dbfc1b5e9ca0107cd1a1bd

Contents?: true

Size: 1.05 KB

Versions: 90

Compression:

Stored size: 1.05 KB

Contents

/* globals Heroku */

//= require utils

Heroku.SearchResultsPaginator = function () {
  function SearchResultsPaginator(_ref) {
    var more = _ref.more;
    var less = _ref.less;
    var helper = _ref.helper;

    _classCallCheck(this, SearchResultsPaginator);

    this.$more = $(more);
    this.$less = $(less);
    this.helper = helper;

    this.$more.on('click', this.handleMoreClick.bind(this));
    this.$less.on('click', this.handleLessClick.bind(this));
  }

  _createClass(SearchResultsPaginator, [{
    key: 'handleMoreClick',
    value: function handleMoreClick(e) {
      e.preventDefault();
      this.searchWithNewPage(this.helper.getPage() + 1);
    }
  }, {
    key: 'handleLessClick',
    value: function handleLessClick(e) {
      e.preventDefault();
      this.searchWithNewPage(this.helper.getPage() - 1);
    }
  }, {
    key: 'searchWithNewPage',
    value: function searchWithNewPage(pageNum) {
      $(window).scrollTop($('#search-form').offset().top);
      this.helper.setPage(pageNum).search();
    }
  }]);

  return SearchResultsPaginator;
}();

Version data entries

90 entries across 90 versions & 1 rubygems

Version Path
bookends-10.4.4 app/assets/javascripts/search/search-results-paginator.js
bookends-10.4.3 app/assets/javascripts/search/search-results-paginator.js
bookends-10.4.2 app/assets/javascripts/search/search-results-paginator.js
bookends-10.4.1 app/assets/javascripts/search/search-results-paginator.js
bookends-10.4.0 app/assets/javascripts/search/search-results-paginator.js
bookends-10.3.4 app/assets/javascripts/search/search-results-paginator.js
bookends-10.3.3 app/assets/javascripts/search/search-results-paginator.js
bookends-10.3.2 app/assets/javascripts/search/search-results-paginator.js
bookends-10.3.1 app/assets/javascripts/search/search-results-paginator.js
bookends-10.3.0 app/assets/javascripts/search/search-results-paginator.js
bookends-10.2.8 app/assets/javascripts/search/search-results-paginator.js
bookends-10.2.7 app/assets/javascripts/search/search-results-paginator.js
bookends-10.2.6 app/assets/javascripts/search/search-results-paginator.js
bookends-10.2.5 app/assets/javascripts/search/search-results-paginator.js
bookends-10.2.5.alpha8 app/assets/javascripts/search/search-results-paginator.js
bookends-10.2.5.alpha7 app/assets/javascripts/search/search-results-paginator.js
bookends-10.2.5.alpha6 app/assets/javascripts/search/search-results-paginator.js
bookends-10.2.5.alpha5 app/assets/javascripts/search/search-results-paginator.js
bookends-10.2.5.alpha4 app/assets/javascripts/search/search-results-paginator.js
bookends-10.2.5.alpha3 app/assets/javascripts/search/search-results-paginator.js