Sieve Scripts use radio buttons to prevent confusion

This commit is contained in:
the-djmaze 2022-05-17 16:53:32 +02:00
parent 723ebc4055
commit ddb95b925d
2 changed files with 6 additions and 10 deletions

View file

@ -43,7 +43,7 @@ export class UserSettingsFilters /*extends AbstractViewSettings*/ {
onBuild(oDom) {
oDom.addEventListener('click', event => {
const el = event.target.closestWithin('.script-item .e-action', oDom),
const el = event.target.closestWithin('.script-item .script-name', oDom),
script = el && ko.dataFor(el);
script && this.editScript(script);
});

View file

@ -17,10 +17,8 @@
<!-- ko if: allowFilters() -->
<tr><th colspan="4" data-i18n="SETTINGS_FILTERS/SIMPLE"></th></tr>
<tr class="script-item">
<td>
<span class="fontastic" data-bind="click: function (oScript) { $root.toggleScript(oScript); }, text: active() ? '☑' : '☐'"></span>
</td>
<td class="e-action" class="script-name" data-bind="text: name()"></td>
<td class="e-action fontastic" data-bind="click: function (oScript) { $root.toggleScript(oScript); }, text: active() ? '⦿' : '○'"></td>
<td class="e-action script-name" data-bind="text: name()"></td>
<td></td>
<td></td>
</tr>
@ -28,16 +26,14 @@
<!-- /ko -->
<!-- ko if: !allowFilters() -->
<tr class="script-item">
<td>
<span class="fontastic" data-bind="click: function (oScript) { $root.toggleScript(oScript); }, text: active() ? '☑' : '☐'"></span>
</td>
<td class="e-action" class="script-name" data-bind="text: name()"></td>
<td class="e-action fontastic" data-bind="click: function (oScript) { $root.toggleScript(oScript); }, text: active() ? '⦿' : '○'"></td>
<td class="e-action script-name" data-bind="text: name()"></td>
<td>
<a class="btn btn-small btn-danger button-confirm-delete" data-bind="css: {'delete-access': askDelete()}, click: function(oScript) { $root.deleteScript(oScript); }"
data-i18n="GLOBAL/ARE_YOU_SURE"></a>
</td>
<td>
<span class="delete-script fontastic" data-bind="visible: !askDelete() && canBeDeleted(), click: function (oScript) { $root.scriptForDeletion(oScript); }">🗑</span>
<span class="e-action fontastic" data-bind="visible: !askDelete() && canBeDeleted(), click: function (oScript) { $root.scriptForDeletion(oScript); }">🗑</span>
</td>
</tr>
<!-- /ko -->