mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 05:05:42 +00:00 
			
		
		
		
	add delete button for notifications
This commit is contained in:
		| @@ -90,7 +90,8 @@ function loadNotificationTable(table, options={}) { | |||||||
|             { |             { | ||||||
|                 formatter: function(value, row, index, field) { |                 formatter: function(value, row, index, field) { | ||||||
|                     var bRead = getReadEditButton(row.pk, row.read) |                     var bRead = getReadEditButton(row.pk, row.read) | ||||||
|                     var html = "<div class='btn-group float-right' role='group'>" + bRead + "</div>"; |                     var bDel = "<button title='{% trans "Delete Notification" %}' class='notification-delete btn btn-outline-secondary' type='button' pk='" + row.pk + "'><span class='fas fa-trash-alt icon-red'></span></button>"; | ||||||
|  |                     var html = "<div class='btn-group float-right' role='group'>" + bRead + bDel + "</div>"; | ||||||
|                     return html; |                     return html; | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
| @@ -126,5 +127,15 @@ $("#history-refresh").on('click', function() { | |||||||
|     $("#history-table").bootstrapTable('refresh'); |     $("#history-table").bootstrapTable('refresh'); | ||||||
| }); | }); | ||||||
|  |  | ||||||
|  | $("#history-table").on('click', '.notification-delete', function() { | ||||||
|  |     constructForm(`/api/notifications/${$(this).attr('pk')}/`, { | ||||||
|  |         method: 'DELETE', | ||||||
|  |         title: '{% trans "Delete Notification" %}', | ||||||
|  |         onSuccess: function(data) { | ||||||
|  |             updateNotificationTables(); | ||||||
|  |         } | ||||||
|  |     }); | ||||||
|  | }); | ||||||
|  |  | ||||||
| enableSidebar('notifications'); | enableSidebar('notifications'); | ||||||
| {% endblock %} | {% endblock %} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user