Sha256: 782b103037c1560ac7d18e314827ed8705136d71e99b825a9ed81da54ba5a894

Contents?: true

Size: 697 Bytes

Versions: 5

Compression:

Stored size: 697 Bytes

Contents

"use strict";

(function () {
  window.initializeResourceDetails = function () {
    $('.o-resource-downloads__btn').click(function () {
      $('.o-resource-downloads__list', $(this).parent()).toggle('fast');
      $('.o-resource-downloads__btn--more', $(this).parent()).toggle();
      $('.o-resource-downloads__btn--less', $(this).parent()).toggle();
    });
    [].forEach.call(document.querySelectorAll('a.resource-attachment'), function (el) {
      if (!el.dataset.heapData) return;
      var data = JSON.parse(el.dataset.heapData);

      if (data) {
        el.addEventListener('click', function () {
          heapTrack('Resource download', data);
        });
      }
    });
  };
})();

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lcms-engine-0.1.4 app/assets/javascripts/lcms/engine/initializers/resource_details.js
lcms-engine-0.1.3 app/assets/javascripts/lcms/engine/initializers/resource_details.js
lcms-engine-0.2.0 app/assets/javascripts/lcms/engine/initializers/resource_details.js
lcms-engine-0.1.2 app/assets/javascripts/lcms/engine/initializers/resource_details.js
lcms-engine-0.1.0 app/assets/javascripts/lcms/engine/initializers/resource_details.js