- January 7, 2010
- Not specified
- admin jquery save
- 2 (after 2 ratings)
This snippet is helpful if you do a lot of editing on a single large admin form (for example, in a rich text field), and want to frequently save your progress. If you press control-S, or command-S on a Mac, the admin change form will save and reload, and the page will scroll back down to where you last were.
This snippet relies on jquery, jquery.cookie, and the shortcut.js keyboard library (which doesn't use jquery, but seemed more robust than the jquery keyboard plugins I saw). It uses a temporary cookie to remember where the page was scrolled to, to avoid having to override the admin behavior.
Note: don't put this in templates/admin/change_form.html -- the circular import causes a Django crash.
Edit: Had forgotten to include jquery.cookie, which I was already including elsewhere.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
More like this
- FieldsetForm by Ciantic 8 years, 1 month ago
- Django using admin horizontal filter in forms by crodjer 3 years, 11 months ago
- Admin Input Field Character Count via jQuery by joshman 6 years, 5 months ago
- Make hyperlinks for labels of raw_id_fields (jQuery) by ramen 5 years, 5 months ago
- Confirm alert if the user navigates away without saving changes by mrazzari 5 years, 10 months ago