Sha256: 9ee340a488dbfe47b9a28a8d87d894dc1288f54c7e669d16c88091138c43290a

Contents?: true

Size: 592 Bytes

Versions: 8

Compression:

Stored size: 592 Bytes

Contents

(function() {
  "use strict";

  var body, links;

  App.register('component').enter(function() {
    body = $('body');
    links = $('a[href]:not([href^="#"]):not([target="_blank"])');

    // Add 'loading' class to the body when a link is clicked,
    // add add 'active' class to the clicked link.
    links.click(function() {
      links.removeClass('active');
      body.addClass('loading');
      $(this).addClass('active');
    });
  }).exit(function() {
    // Remove the classes when the body is unloaded
    body.removeClass('loading');
    links.removeClass('active');
  });
})();

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
codelation_ui-1.0.57 app/assets/javascripts/codelation_ui/_base_resources/components/link.js
codelation_ui-1.0.1 app/assets/javascripts/codelation_ui/_base_resources/components/link.js
codelation_ui-1.0.0 app/assets/javascripts/codelation_ui/_base_resources/components/link.js
blogelator-1.0.9 app/assets/javascripts/blog/components/link.js
blogelator-1.0.7 app/assets/javascripts/blog/components/link.js
blogelator-1.0.6 app/assets/javascripts/blog/components/link.js
blogelator-1.0.5 app/assets/javascripts/blog/components/link.js
blogelator-1.0.4 app/assets/javascripts/blog/components/link.js