<commit_before>kd = require 'kd'
React = require 'kd-react'

PerfectScrollbar = require 'app/components/perfectscrollbar'

module.exports = class Scroller extends React.Component

  @defaultProps =
    hasMore               : no
    threshold             : 1
    onThresholdReached    : kd.noop
    onTopThresholdReached : kd.noop
    minScrollbarLength    : 64
    useSelectionScroll    : on

  onUpLimitReached: ->

    return  unless @props.hasMore

    @props.onTopThresholdReached?()


  onDownLimitReached: ->

    return  unless @props.hasMore

    @props.onThresholdReached?()


  render: ->

    <PerfectScrollbar
      {...@props}
      className={kd.utils.curry 'Scrollable', @props.className}
      onUpLimitReached={@bound 'onUpLimitReached'}
      onDownLimitReached={@bound 'onDownLimitReached'}
      ref='scrollContainer'><commit_msg>Client: Activity: Added onScroll event handler to scroller component<commit_after>kd = require 'kd'
React = require 'kd-react'

PerfectScrollbar = require 'app/components/perfectscrollbar'

module.exports = class Scroller extends React.Component

  @defaultProps =
    hasMore               : no
    onScroll              : kd.noop
    threshold             : 1
    onThresholdReached    : kd.noop
    onTopThresholdReached : kd.noop
    minScrollbarLength    : 64
    useSelectionScroll    : on

  onUpLimitReached: ->

    return  unless @props.hasMore

    @props.onTopThresholdReached?()


  onDownLimitReached: ->

    return  unless @props.hasMore

    @props.onThresholdReached?()


  render: ->

    <PerfectScrollbar
      {...@props}
      className={kd.utils.curry 'Scrollable', @props.className}
      onUpLimitReached={@bound 'onUpLimitReached'}
      onDownLimitReached={@bound 'onDownLimitReached'}
      ref='scrollContainer'>
{'fraction_non_alphanumeric': 0.09592861126603458, 'fraction_numerical': 0.0033463469046291134, 'mean_word_length': 2.9342105263157894, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1207920', 'n_tokens_mistral': 573, 'n_tokens_neox': 534, 'n_words': 105}