Sha256: 52bca4b2f5d96c9f6e49fbbf53a82402382e95e6bb60cd6cf6db750c8d873400

Contents?: true

Size: 423 Bytes

Versions: 9

Compression:

Stored size: 423 Bytes

Contents

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

export default class extends Controller {
  async open() {
    const newPath = this.data.get('path')

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

Version data entries

9 entries across 9 versions & 1 rubygems

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