Sha256: b27fbace545021c4ab8573b340097ea01d85363fd29a5a6877b81f3fe5985aa8

Contents?: true

Size: 1.01 KB

Versions: 3

Compression:

Stored size: 1.01 KB

Contents

$(document).ready(function() {
  function setFrontHeight(element) {
    var height = element.height();
    element.css({ height: height + 'px' }).attr('data-original-height', height);
  }

  function removeFrontHeight(element) {
    element.css({ height: 'inherit' });
  }

  $('.assessment .flip-action a').on('click', function() {
    $(this).closest('.assessment').addClass('flip');

    var front = $(this).closest('.front');
    setFrontHeight(front);

    var frontHeight = front.height();

    var back = $(this).closest('.front').next('.back');
    var backHeight = back.height();

    if (frontHeight > backHeight) {
      back.css({ height: '100%' });
    } else {
      front.css({ height: backHeight + 'px' });
    }
  });

  $('.assessment .flip-action-back a').on('click', function() {
    var assessment = $(this).closest('.assessment').removeClass('flip');
    var front = assessment.find('.front');
    removeFrontHeight(front);
  });

  $('.touch .alert').click(function() {
    $(this).alert('close');
  });
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
woople-theme-0.3.5 app/assets/javascripts/woople-theme/assessment_overview.js
woople-theme-0.3.04 app/assets/javascripts/woople-theme/assessment_overview.js
woople-theme-0.3.03 app/assets/javascripts/woople-theme/assessment_overview.js