From 5cb0f1ebf8d8abb75782e3c4a86cd1b582450f59 Mon Sep 17 00:00:00 2001 From: Brandon Taylor Date: Wed, 28 Aug 2019 07:53:50 -0400 Subject: [PATCH] Fix Font Awesome Icon selection scoping - Narrowed scoping of selector so it doesn't interfere with custom widgets after drop - Version bump to 2.0.18 - Updated README --- README.md | 4 ++-- adminsortable/__init__.py | 2 +- .../edit_inline/admin.sortable.tabular.inlines.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c256b07..9639940 100644 --- a/README.md +++ b/README.md @@ -606,8 +606,8 @@ ordering on top of that just seemed a little much in my opinion. ### Status django-admin-sortable is currently used in production. -### What's new in 2.1.17? -- Fixed Ukrainian translations courtesy of [@Serhiy](https://github.com/SerhiyRomanov) +### What's new in 2.1.18? +- Fixed scoping issue with Font Awesome Icons if you're using a custom widget in inline models ### Future - Better template support for foreign keys that are self referential. If someone would like to take on rendering recursive sortables, that would be super. diff --git a/adminsortable/__init__.py b/adminsortable/__init__.py index edd8ca2..b0c40ed 100644 --- a/adminsortable/__init__.py +++ b/adminsortable/__init__.py @@ -1,4 +1,4 @@ -VERSION = (2, 1, 17) +VERSION = (2, 1, 18) DEV_N = None diff --git a/adminsortable/templates/adminsortable/edit_inline/admin.sortable.tabular.inlines.html b/adminsortable/templates/adminsortable/edit_inline/admin.sortable.tabular.inlines.html index 1a0ab5f..b29f803 100644 --- a/adminsortable/templates/adminsortable/edit_inline/admin.sortable.tabular.inlines.html +++ b/adminsortable/templates/adminsortable/edit_inline/admin.sortable.tabular.inlines.html @@ -40,7 +40,7 @@ data: { indexes : indexes.join(','), csrfmiddlewaretoken: window.csrftoken }, success: function() { // set icons based on position - var icons = ui.item.parent().find('.fa'); + var icons = ui.item.parent().find('a > .fa'); icons.removeClass('fa-sort-desc fa-sort-asc fa-sort'); icons.each(function(index, element) { var icon = $(element);