Sha256: e3a9cbb72989f802d4519f1a22d2c8737efd1be9ea98399cfb4afc9e56db3855

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

var Renalware = typeof Renalware === 'undefined' ? {} : Renalware;

Renalware.Renal = (function () {

  var setAllComobidityOptionsToNo = function() {
    $(document).on( "click", "a.set_all_comorbidities_to_no", function(e) {
      e.preventDefault();
      $(".comorbidities input[type=radio][value=no]").prop("checked", true);
    });
  };

  // If the user wants to overwrite or copy in the patient's current address, clone this
  // from a hidden form and use it to replace the existing visible address form.
  var wireUpUseCurrentAddressButton = function() {
    $("body.renal-profile-edit").on("click",
                                    "#use-current-address-for-address-at-diagnosis",
                                    function(e) {
      e.preventDefault();
      $("#hidden-current-address-form .form-content")
        .clone()
        .replaceAll("#visible-address-form .form-content")
    });
  }

  return {
    init : function() {
      setAllComobidityOptionsToNo();
      wireUpUseCurrentAddressButton();
    }
  }
})();

$(document).ready(Renalware.Renal.init);

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.beta4 app/assets/javascripts/renalware/renal.js