| 2081 | 2081 | // Prevents the expression from being set |
| 2082 | 2082 | event.stopPropagation(); |
| 2083 | 2083 | |
| 2084 | | - const confirmation = await callPopup('<h3>Are you sure?</h3>Once deleted, it\'s gone forever!', 'confirm'); |
| 2084 | + const expressionListItem = $(this).closest('.expression_list_item'); |
| 2085 | + const expression = expressionListItem.data('expression'); |
| 2085 | 2086 | |
| 2087 | + const confirmation = await Popup.show.confirm(t`Delete Expression`, t`Are you sure you want to delete this expression? Once deleted, it\'s gone forever!` |
| 2088 | + + '<br /><br />' |
| 2089 | + + t`Expression: ` |
| 2090 | + + expressionListItem.attr('data-filename')); |
| 2086 | 2091 | if (!confirmation) { |
| 2087 | 2092 | return; |
| 2088 | 2093 | } |
| 2089 | 2094 | |
| 2090 | 2095 | const expressionfileName = $(this)expressionListItem.closestattr('.expression_list_item').data('expression-filename'); |
| 2091 | 2096 | const name = $('#image_list').data('name'); |
| 2092 | 2097 | |
| 2093 | 2098 | try { |
| 2094 | 2099 | await fetch('/api/sprites/delete', { |
| 2095 | 2100 | method: 'POST', |
| 2096 | 2101 | headers: getRequestHeaders(), |
| 2097 | 2102 | body: JSON.stringify({ name, label: expression, spriteName: fileName }), |
| 2098 | 2103 | }); |
| 2099 | 2104 | } catch (error) { |
| 2100 | 2105 | toastr.error('Failed to delete image. Try again later.'); |