mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
attachments: Use data-attachment-id to refer to attachments.
This may fix an issue with the delete button not actually sending the right data to the server; I'm not sure. Extracted from a patch by Aastha Gupta.
This commit is contained in:
@@ -87,7 +87,7 @@ function render_attachments_ui(attachments) {
|
|||||||
$('#uploaded_files_table').on('click', '.remove-attachment', function (e) {
|
$('#uploaded_files_table').on('click', '.remove-attachment', function (e) {
|
||||||
var row = $(e.target).closest(".uploaded_file_row");
|
var row = $(e.target).closest(".uploaded_file_row");
|
||||||
row.remove();
|
row.remove();
|
||||||
delete_attachments($(this).data('attachment'));
|
delete_attachments($(this).attr('data-attachment-id'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{{#with attachment}}
|
{{#with attachment}}
|
||||||
<tr class="uploaded_file_row" id="{{name}}">
|
<tr class="uploaded_file_row" id="{{name}}" data-attachment-id="{{id}}">
|
||||||
<td>
|
<td>
|
||||||
<a type="submit" href="/user_uploads/{{path_id}}" target="_blank" title="{{t 'View file' }}">
|
<a type="submit" href="/user_uploads/{{path_id}}" target="_blank" title="{{t 'View file' }}">
|
||||||
{{ name }}
|
{{ name }}
|
||||||
|
|||||||
Reference in New Issue
Block a user