Browse Source

CustomCategory: apply-close -> do not close after error

master
parent
commit
b7b0812bfa
  1. 9
      src/customCategory.js

9
src/customCategory.js

@ -129,8 +129,9 @@ class CustomCategoryEditor {
inputClose.type = 'button' inputClose.type = 'button'
inputClose.value = lang('apply-close') inputClose.value = lang('apply-close')
inputClose.onclick = () => { inputClose.onclick = () => {
this.submit()
this.window.close()
if (this.submit()) {
this.window.close()
}
} }
controls.appendChild(inputClose) controls.appendChild(inputClose)
@ -164,10 +165,12 @@ class CustomCategoryEditor {
submit () { submit () {
const err = customCategoryTest(this.textarea.value) const err = customCategoryTest(this.textarea.value)
if (err) { if (err) {
return global.alert(err)
global.alert(err)
return false
} }
this.applyContent(this.textarea.value) this.applyContent(this.textarea.value)
return true
} }
applyContent (content) { applyContent (content) {

Loading…
Cancel
Save