Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore translation for delete confirmation #97

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading