basically working for one user (no user/all users actually)

This commit is contained in:
Thelonius Kort
2020-07-13 18:53:18 +02:00
parent 24fcc831af
commit 7e5d8ebc2c
3 changed files with 51 additions and 2 deletions

View File

@ -17,8 +17,18 @@ import {Socket} from "phoenix"
import NProgress from "nprogress"
import {LiveSocket} from "phoenix_live_view"
let Hooks = {}
Hooks.SnippetInput = {
updated(){
// + cursor reposition logic
// console.log(['dings', this.el.dataset])
this.el.value = this.el.dataset.updatedVal
// this.el.select()
}
}
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}})
let liveSocket = new LiveSocket("/live", Socket, {hooks: Hooks, params: {_csrf_token: csrfToken}})
// Show progress bar on live navigation and form submits
window.addEventListener("phx:page-loading-start", info => NProgress.start())