Sha256: b01df0d2468efc12ed481aa84226dc1fa8c98c8c90c003078d69ece1a93f6809

Contents?: true

Size: 580 Bytes

Versions: 7

Compression:

Stored size: 580 Bytes

Contents

jQuery.widget('pageflow.markWithPlayedStates', {
  attach: function(player) {
    var element = this.element;

    player.on('play', function() {
      element.removeClass('unplayed');
    });

    player.on('pause', function() {
      element.addClass('has_played');
    });
  },

  reset: function(options) {
    this.element.toggleClass('unplayed', !this._willAutoplay(options));
    this.element.removeClass('has_played');
  },

  _willAutoplay: function(options) {
    options = options || {};
    return options.autoplay && !pageflow.browser.has('mobile platform');
  }
});

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pageflow-0.11.4 app/assets/javascripts/pageflow/widgets/mark_with_played_states.js
pageflow-12.0.0.rc2 app/assets/javascripts/pageflow/widgets/mark_with_played_states.js
pageflow-12.0.0.rc1 app/assets/javascripts/pageflow/widgets/mark_with_played_states.js
pageflow-0.11.3 app/assets/javascripts/pageflow/widgets/mark_with_played_states.js
pageflow-0.11.2 app/assets/javascripts/pageflow/widgets/mark_with_played_states.js
pageflow-0.11.1 app/assets/javascripts/pageflow/widgets/mark_with_played_states.js
pageflow-0.11.0 app/assets/javascripts/pageflow/widgets/mark_with_played_states.js