Sha256: eae4eb600905a41773f872fbdb7183e27f0791615de049c9087f17613d8c6633

Contents?: true

Size: 447 Bytes

Versions: 9

Compression:

Stored size: 447 Bytes

Contents

import { Controller } from "stimulus"
import axios from "axios"

export default class extends Controller {
  async open(event) {
    event.preventDefault()
    const path = this.element.href

    try {
      const response = await axios.get(path)
      document.querySelector('#commit-modal-wrapper').innerHTML = response.data
      document.querySelector('#commit-modal input').focus()
    } catch (error) {
      console.error(error)
    }
  }
}

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
yarii-editor-0.4.8 app/javascript/controllers/push_to_public_controller.js
yarii-editor-0.4.7 app/javascript/controllers/push_to_public_controller.js
yarii-editor-0.4.6 app/javascript/controllers/push_to_public_controller.js
yarii-editor-0.4.5 app/javascript/controllers/push_to_public_controller.js
yarii-editor-0.4.4 app/javascript/controllers/push_to_public_controller.js
yarii-editor-0.4.3 app/javascript/controllers/push_to_public_controller.js
yarii-editor-0.4.2 app/javascript/controllers/push_to_public_controller.js
yarii-editor-0.4.1 app/javascript/controllers/push_to_public_controller.js
yarii-editor-0.4.0 app/javascript/controllers/push_to_public_controller.js