Sha256: 7291cc4124f3eeb21b90de60954abd89aca2cefb13dd8db006261df2db67066b

Contents?: true

Size: 653 Bytes

Versions: 15

Compression:

Stored size: 653 Bytes

Contents

(($) => {
  const COMPONENT_SELECTOR = '[data-thredded-currently-online]';

  class ThreddedCurrentlyOnline {
    init($nodes) {
      $($nodes).
        on('mouseenter', function(e) {
          $(this).addClass('thredded--is-expanded');
        }).
        on('mouseleave', function(e) {
          $(this).removeClass('thredded--is-expanded');
        }).
        on('touchstart', function(e) {
          $(this).toggleClass('thredded--is-expanded');
        });
    }
  }

  window.Thredded.onPageLoad(() => {
    const $nodes = $(COMPONENT_SELECTOR);
    if ($nodes.length) {
      new ThreddedCurrentlyOnline().init($nodes);
    }
  });
})(jQuery);

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
thredded-0.12.4 app/assets/javascripts/thredded/components/currently_online.es6
thredded-0.12.3 app/assets/javascripts/thredded/components/currently_online.es6
thredded-0.12.2 app/assets/javascripts/thredded/components/currently_online.es6
thredded-0.12.1 app/assets/javascripts/thredded/components/currently_online.es6
thredded-0.12.0 app/assets/javascripts/thredded/components/currently_online.es6
thredded-0.11.1 app/assets/javascripts/thredded/components/currently_online.es6
thredded-0.11.0 app/assets/javascripts/thredded/components/currently_online.es6
thredded-0.10.1 app/assets/javascripts/thredded/components/currently_online.es6
thredded-0.10.0 app/assets/javascripts/thredded/components/currently_online.es6
thredded-0.9.4 app/assets/javascripts/thredded/components/currently_online.es6
thredded-0.9.3 app/assets/javascripts/thredded/components/currently_online.es6
thredded-0.9.2 app/assets/javascripts/thredded/components/currently_online.es6
thredded-0.9.1 app/assets/javascripts/thredded/components/currently_online.es6
thredded-0.8.4 app/assets/javascripts/thredded/components/currently_online.es6
thredded-0.8.2 app/assets/javascripts/thredded/components/currently_online.es6