File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,7 @@ public function createElements(array $formData)
184184 [
185185 'ignore ' => true ,
186186 'label ' => $ this ->translate ('Delete config ' ),
187+ 'data-confirmation ' => $ this ->translate ('Confirm deletion ' ),
187188 'class ' => 'btn-remove ' ,
188189 'decorators ' => ['ViewHelper ' ]
189190 ]
Original file line number Diff line number Diff line change 1515 this . module . on ( 'rendered' , this . rendered ) ;
1616 } ,
1717
18+ /**
19+ * rendered adds the CodeMirror editor to the designated div
20+ */
1821 rendered : function ( ev ) {
1922 this . collapseOnLoad ( ev ) ;
2023 var $container = $ ( ev . currentTarget ) ;
3740 } ) ;
3841 } ,
3942
43+ /**
44+ * processTreeNodeClick toggles the collapsed status of the tree nodes
45+ */
4046 processTreeNodeClick : function ( event ) {
4147 event . stopPropagation ( ) ;
4248 var $el = $ ( event . currentTarget ) ;
5157 }
5258 } ,
5359
60+ /**
61+ * collapseOnLoad sets all OK nodes to collapsed,
62+ * because these are not as interesting.
63+ */
5464 collapseOnLoad : function ( event ) {
5565 var $el = $ ( event . currentTarget ) ;
5666 $el . find ( '.tlv-view-tree .tlv-tree-node.tlv-collapsible.ok' ) . addClass ( 'tlv-collapsed' ) ;
5767 } ,
5868
69+ /**
70+ * onRemoveClick shows a Browser confirmation windows.
71+ */
5972 onRemoveClick : function ( event ) {
6073 event . stopPropagation ( ) ;
61- return confirm ( 'Confirm deletion?' )
74+ let target = event . currentTarget ;
75+ const confirmMsg = target . getAttribute ( 'data-confirmation' ) ;
76+
77+ return confirm ( confirmMsg ) ;
6278 } ,
6379
6480 buttonClick : function ( event ) {
You can’t perform that action at this time.
0 commit comments