$click to allow (more) responsiveness

This commit is contained in:
JFH
2022-01-05 20:55:42 -03:00
parent 9652e3affe
commit a48fc66c1c
32 changed files with 161 additions and 156 deletions

View File

@@ -1,3 +1,4 @@
/* globals svgEditor */
import editorPreferencesDialog from './editorPreferencesDialog.html'
const template = document.createElement('template')
template.innerHTML = editorPreferencesDialog
@@ -374,13 +375,13 @@ export class SeEditPrefsDialog extends HTMLElement {
const blocks = this.$bgBlocks.querySelectorAll('div')
const curBg = 'cur_background'
blocks.forEach(function (blk) {
blk.addEventListener('click', function () {
svgEditor.$click(blk, function () {
blocks.forEach((el) => el.classList.remove(curBg))
blk.classList.add(curBg)
})
})
this.$saveBtn.addEventListener('click', onSaveHandler)
this.$cancelBtn.addEventListener('click', onCancelHandler)
svgEditor.$click(this.$saveBtn, onSaveHandler)
svgEditor.$click(this.$cancelBtn, onCancelHandler)
this.$dialog.addEventListener('close', onCancelHandler)
}
}