A spinning activity indicator for kintone
Attach following file into kintone app setting
dist/kintone-spinner.min.js
Attach following URL into kintone app setting (Hosted by jsDelivr)
https://cdn.jsdelivr.net/npm/kintone-spinner
https://cdn.jsdelivr.net/npm/kintone-spinner@x.x.x
$ npm install --save kintone-spinner
or
$ yarn add kintone-spinner
import Spinner from 'kintone-spinner'
kintone.events.on('app.record.index.show', event => {
const spinner = new Spinner()
document.body.appendChild(spinner.render())
const button = document.createElement('button')
button.innerText = 'Spin!'
button.onclick = async () => {
const seconds = Number(prompt('Please input seconds', 3))
if (!seconds) {
return
}
spinner.show()
await new Promise(resolve => setTimeout(resolve, seconds * 1000))
spinner.hide()
alert('Finished!')
}
kintone.app.getHeaderMenuSpaceElement().appendChild(button)
})
This library uses Spinner of kintone UI Component without React.
https://kintone.github.io/kintone-ui-component/Reference/Spinner/