editor: make sure grid width input updates after every event
This commit is contained in:
parent
932558e338
commit
6209b67a1e
1 changed files with 7 additions and 5 deletions
|
|
@ -130,11 +130,13 @@ module.exports = {
|
|||
i = $('<input type="number" step="1" min="1" max="100"></div>').appendTo(w)
|
||||
i.val(GRIDWIDTH)
|
||||
i.on('keyup mouseup change mousewheel',()=>{
|
||||
var v = Math.max(Math.min(parseInt(i.val()),100),1)
|
||||
if (isNaN(v)) return
|
||||
i.val(v)
|
||||
GRIDWIDTH = v
|
||||
document.documentElement.style.setProperty("--grid-width",GRIDWIDTH)
|
||||
setTimeout(()=>{
|
||||
var v = Math.max(Math.min(parseInt(i.val()),100),1)
|
||||
if (isNaN(v)) return
|
||||
i.val(v)
|
||||
GRIDWIDTH = v
|
||||
document.documentElement.style.setProperty("--grid-width",GRIDWIDTH)
|
||||
})
|
||||
})
|
||||
$('.editor').append(f)
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue