IT61/it61-rails

View on GitHub
app/assets/javascripts/components/buttons.js

Summary

Maintainability
A
0 mins
Test Coverage
$(document).ready(function () {
  $('.btn-fab').click(function () {
    if ($('.btn-fab.child').is(':visible')) {
      $('.btn-fab.child').stop().animate({
        top: $(this).css('top'),
        opacity: 0
      }, 125, function () {
        $(this).hide();
      });
    } else {
      $('.btn-fab.child').each(function () {
        $(this)
          .stop()
          .show()
          .animate({
            top: parseInt($(this).height() + 50 * $(this).data('subitem')) + 'px',
            opacity: 1
          }, 125);
      });
    }
  });
});