Compare commits

..

No commits in common. "6687cd53babcc5694fbbf5ae517e79dfeb9484ef" and "07363fa5fe2ac18cada975ae0582ce82e6e9d639" have entirely different histories.

2 changed files with 5 additions and 23 deletions

View file

@ -136,21 +136,7 @@ class Rule {
.map((str) => `${value}${str || ''}`)
}
})
const backButton = Utils.loadTemplate(`
<button class="flat" type="button" data-ref="add">
<i class="icon icon-16 icon-back" title="${translate('Back to list')}"></i>
</button>`)
backButton.addEventListener('click', () =>
this._umap.edit().then(() => {
this._umap.editPanel.container.querySelector('details#rules').open = true
})
)
this._umap.editPanel.open({
content: container,
highlight: 'settings',
actions: [backButton],
})
this._umap.editPanel.open({ content: container, highlight: 'settings' })
}
renderToolbox(ul) {
@ -208,7 +194,6 @@ export default class Rules {
}
onReorder(src, dst, initialIndex, finalIndex) {
const oldRules = Utils.CopyJSON(this._umap.properties.rules || {})
const moved = this.rules.find((rule) => stamp(rule) === +src.dataset.id)
const reference = this.rules.find((rule) => stamp(rule) === +dst.dataset.id)
const movedIdx = this.rules.indexOf(moved)
@ -224,17 +209,14 @@ export default class Rules {
this.rules.splice(newIdx, 0, moved)
this._umap.render(['rules'])
this.commit()
this._umap.sync.update('properties.rules', this._umap.properties.rules, oldRules)
}
edit(container) {
const template = `
<details id="rules">
<details>
<summary>${translate('Conditional style rules')}</summary>
<fieldset>
<ul data-ref=ul></ul>
<button class="umap-add" type="button" data-ref=add>${translate('Add rule')}</button>
</fieldset>
<fieldset><ul data-ref=ul></ul></fieldset>
<button class="umap-add" type="button" data-ref=add>${translate('Add rule')}</button>
</details>
`
const [body, { ul, add }] = Utils.loadTemplateWithRefs(template)

View file

@ -1181,7 +1181,7 @@ export default class Umap {
}
this._advancedActions(container)
return this.editPanel.open({
this.editPanel.open({
content: container,
className: 'dark',
highlight: 'settings',