Sha256: 08c2579f8632c37525b31d218b34a900b58c786d2b0f57f28847b71c9c0adac6

Contents?: true

Size: 1.34 KB

Versions: 21

Compression:

Stored size: 1.34 KB

Contents

jQuery.fn.exists = function(){return this.length>0;}

$(function () {
  // all activate-submit buttons are disabled by default
  $('.activate-submit').each(function() {
    $(this).prop('disabled', true);
  });
  // set up tooltip
  $('.activate-container').tooltip({
    'placement': 'bottom',
    'delay': {show: 500, hide: 100}
    });

  // when data-activate checkbox is clicked, change the
  // disable state of all activate-submit buttons
  $('input[data-activate]').on("click", function () {
    // get the checked state of the checkbox clicked and 
    // set  all other tos checkboxes to same state
    var bool = $(this).is(":checked");
    // if box is checked - enable submit, otherwise disable 
    var disable = (bool) ? false : true;
    $('input[data-activate]').attr('checked', bool);
    $('.activate-submit').attr('disabled', disable);
  })

  // show/hide the tooltip depending if the agreement is already checked
  $('.activate-container').mousemove(function(e){
    if ($('input[data-activate]').is(':checked')) {
      $('.activate-container').tooltip('hide')
    }
    else {
      $('.activate-container').tooltip('show')
    }
  });
  $('.activate-container').mouseout(function(e){
      $('.activate-container').tooltip('hide')
  });
  $('.activate-container').mouseleave(function(e){
      $('.activate-container').tooltip('hide')
  });
});

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
sufia-3.7.2 app/assets/javascripts/terms_of_service.js
sufia-3.7.1 app/assets/javascripts/terms_of_service.js
sufia-3.7.0 app/assets/javascripts/terms_of_service.js
sufia-3.6.1 app/assets/javascripts/terms_of_service.js
sufia-3.6.0 app/assets/javascripts/terms_of_service.js
sufia-3.5.0 app/assets/javascripts/terms_of_service.js
sufia-3.4.0 app/assets/javascripts/terms_of_service.js
sufia-3.4.0.rc4 app/assets/javascripts/terms_of_service.js
sufia-3.4.0.rc3 app/assets/javascripts/terms_of_service.js
sufia-3.3.1 app/assets/javascripts/terms_of_service.js
sufia-3.4.0.rc2 app/assets/javascripts/terms_of_service.js
sufia-3.4.0.rc1 app/assets/javascripts/terms_of_service.js
sufia-3.3.0 app/assets/javascripts/terms_of_service.js
sufia-3.2.1 app/assets/javascripts/terms_of_service.js
sufia-3.1.3 app/assets/javascripts/terms_of_service.js
sufia-3.1.2 app/assets/javascripts/terms_of_service.js
sufia-3.1.1 app/assets/javascripts/terms_of_service.js
sufia-3.1.0 app/assets/javascripts/terms_of_service.js
sufia-3.0.0 app/assets/javascripts/terms_of_service.js
sufia-2.0.1 app/assets/javascripts/terms_of_service.js