mirror of
https://github.com/braver/programmingfonts.git
synced 2024-09-08 12:41:32 +02:00
24 lines
464 B
JavaScript
24 lines
464 B
JavaScript
import { Cookies } from './cookies.js'
|
|
|
|
export class Spacing {
|
|
el = document.getElementById('spacing')
|
|
|
|
init () {
|
|
if (Cookies.get('spacing')) {
|
|
this.el.value = Cookies.get('spacing')
|
|
}
|
|
this.el.onchange = () => {
|
|
this.set()
|
|
}
|
|
this.set()
|
|
}
|
|
|
|
set () {
|
|
const spacing = this.el.value
|
|
|
|
document.querySelector('.CodeMirror').style.lineHeight = spacing
|
|
Cookies.set('spacing', spacing)
|
|
window.CMeditor.refresh()
|
|
}
|
|
}
|