BigW Consortium Gitlab

activities.js 1000 Bytes
Newer Older
1
/* eslint-disable */
Fatih Acet committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15
(function() {
  this.Activities = (function() {
    function Activities() {
      Pager.init(20, true, false, this.updateTooltips);
      $(".event-filter-link").on("click", (function(_this) {
        return function(event) {
          event.preventDefault();
          _this.toggleFilter($(event.currentTarget));
          return _this.reloadActivities();
        };
      })(this));
    }

    Activities.prototype.updateTooltips = function() {
16
      return gl.utils.localTimeAgo($('.js-timeago', '.content_list'));
Fatih Acet committed
17 18 19 20 21 22 23 24
    };

    Activities.prototype.reloadActivities = function() {
      $(".content_list").html('');
      return Pager.init(20, true);
    };

    Activities.prototype.toggleFilter = function(sender) {
25 26
      var filter = sender.attr("id").split("_")[0];

Fatih Acet committed
27
      $('.event-filter .active').removeClass("active");
28
      Cookies.set("event_filter", filter);
29 30

      sender.closest('li').toggleClass("active");
Fatih Acet committed
31 32 33 34 35 36 37
    };

    return Activities;

  })();

}).call(this);