Sha256: 9aa79b28da631f5eca07065370ed1c09036cda25cad6984d32aed35c4f975b0b

Contents?: true

Size: 999 Bytes

Versions: 25

Compression:

Stored size: 999 Bytes

Contents

const Rails = window.Rails
import { Controller } from "stimulus"

// Handles the modal dialog used for presenting Home Delivery print options to
// the user. Used on the prescrptions page.
export default class extends Controller {
  static targets = [ "form", "printOptions", "printFeedback" ]

  // Submit and re-display the form when 'drug type' or 'prescription duration'
  // dropdowns are changed
  refreshForm() {
    Rails.fire(this.formTarget, "submit")
  }

  // When the user has clicked Print (launching the PDF in a new tab), hide
  // the Print button and display content which asks whether printing was
  // successful or not. Click one of these 2 buttons will dismiss the modal.
  // FYI if they say Yes (printing was a success) the home delivery
  // event (the object 'behind' our modal form) is updated with printed=true.
  askForPrintFeedback() {
    this.printOptionsTarget.classList.toggle("visuallyhidden")
    this.printFeedbackTarget.classList.toggle("visuallyhidden")
  }
}

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.1.0 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.0.167 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.0.166 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.0.165 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.0.164 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.0.163 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.0.162 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.0.161 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.0.160 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.0.159 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.0.158 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.0.157 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.0.156 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.0.155 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.0.153 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.0.152 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.0.151 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.0.149 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js
renalware-core-2.0.148 app/javascript/renalware/controllers/medications/home_delivery_modal_controller.js