Sha256: 58424d9c5436fcad9e793c8804e00dd00e2fa07353542a36b6ad158bf30f30b9

Contents?: true

Size: 881 Bytes

Versions: 9

Compression:

Stored size: 881 Bytes

Contents

(function($) {
  var events = pageflow.outlineNavigationBar.events;

  $.widget('pageflow.outlineNavigationBarNavigator', {
    _create: function() {
      var element = this.element;
      var scroller = this.options.scroller;
      var links = element.find('a');

      element.on(events.pointerDown, 'a', function(event) {
        event.preventDefault();
        $(this).one(events.pointerUp, goToPage);
      });

      element.on('click', 'a', function(event) {
        event.preventDefault();
      });

      element.on('keydown', 'a', function(event) {
        if (event.which == 13) {
          goToPage.call(this);
        }
      });

      scroller.on('scroll', function() {
        links.off(events.pointerUp, goToPage);
      });

      function goToPage() {
        var id = $(this).data('link');
        pageflow.slides.goToById(id);
      }
    }
  });
}(jQuery));

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
pageflow-outline-navigation-bar-1.6.0 app/assets/javascript/pageflow/outline_navigation_bar/navigator.js
pageflow-outline-navigation-bar-1.5.0 app/assets/javascript/pageflow/outline_navigation_bar/navigator.js
pageflow-outline-navigation-bar-1.4.0 app/assets/javascript/pageflow/outline_navigation_bar/navigator.js
pageflow-outline-navigation-bar-1.3.1 app/assets/javascript/pageflow/outline_navigation_bar/navigator.js
pageflow-outline-navigation-bar-1.3.0 app/assets/javascript/pageflow/outline_navigation_bar/navigator.js
pageflow-outline-navigation-bar-1.2.0 app/assets/javascript/pageflow/outline_navigation_bar/navigator.js
pageflow-outline-navigation-bar-1.1.0 app/assets/javascript/pageflow/outline_navigation_bar/navigator.js
pageflow-outline-navigation-bar-1.0.0 app/assets/javascript/pageflow/outline_navigation_bar/navigator.js
pageflow-outline-navigation-bar-0.1.0 app/assets/javascript/pageflow/outline_navigation_bar/navigator.js