Sha256: 55c2f540ae727fe6a23f706612ffca8bf48136d7100676263bc046fabfe22349

Contents?: true

Size: 1006 Bytes

Versions: 4

Compression:

Stored size: 1006 Bytes

Contents

(function($) {
  $.widget('pageflow.multimediaAlert', {
    _create: function() {
      var widget = this;

      function show() {
        widget.element.show();
        toggleContent(false);
      }

      function hide() {
        widget.element.hide();
        toggleContent(true);
      }

      function toggleContent(state) {
        $('.page .content').toggleClass('initially_hidden', !state);
        $('.slideshow .scroll_indicator').toggleClass('initially_hidden', !state);
      }

      pageflow.manualStart.required().then(function(start) {
        show();

        widget.element.find('.close').one('click', function() {
          hide();

          pageflow.events.trigger('button:close_multimedia_alert');
          start();

          return false;
        });
      });

      pageflow.events.on('request:multimedia_alert', function() {
        show();

        widget.element.find('.close').one('click', function() {
          hide();
        });
      }, this);
    }
  });
}(jQuery));

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pageflow-0.10.0 app/assets/javascripts/pageflow/widgets/multimedia_alert.js
pageflow-0.9.2 app/assets/javascripts/pageflow/widgets/multimedia_alert.js
pageflow-0.9.1 app/assets/javascripts/pageflow/widgets/multimedia_alert.js
pageflow-0.9.0 app/assets/javascripts/pageflow/widgets/multimedia_alert.js