Skip to content

Commit

Permalink
Restore translation for delete confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
martialblog committed Dec 4, 2024
1 parent 5d190a4 commit af7a64b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions application/forms/EditForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ public function createElements(array $formData)
[
'ignore' => true,
'label' => $this->translate('Delete config'),
'data-confirmation' => $this->translate('Confirm deletion'),
'class' => 'btn-remove',
'decorators' => ['ViewHelper']
]
Expand Down
18 changes: 17 additions & 1 deletion public/js/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
this.module.on('rendered', this.rendered);
},

/**
* rendered adds the CodeMirror editor to the designated div
*/
rendered: function (ev) {
this.collapseOnLoad(ev);
var $container = $(ev.currentTarget);
Expand All @@ -37,6 +40,9 @@
});
},

/**
* processTreeNodeClick toggles the collapsed status of the tree nodes
*/
processTreeNodeClick: function (event) {
event.stopPropagation();
var $el = $(event.currentTarget);
Expand All @@ -51,14 +57,24 @@
}
},

/**
* collapseOnLoad sets all OK nodes to collapsed,
* because these are not as interesting.
*/
collapseOnLoad: function (event) {
var $el = $(event.currentTarget);
$el.find('.tlv-view-tree .tlv-tree-node.tlv-collapsible.ok').addClass('tlv-collapsed');
},

/**
* onRemoveClick shows a Browser confirmation windows.
*/
onRemoveClick: function (event) {
event.stopPropagation();
return confirm('Confirm deletion?')
let target = event.currentTarget;
const confirmMsg = target.getAttribute('data-confirmation');

return confirm(confirmMsg);
},

buttonClick: function (event) {
Expand Down

0 comments on commit af7a64b

Please sign in to comment.