Source

django-autohide-help /

Filename Size Date modified Message
autohide_help
38 B
1.6 KB
48 B
145 B
1.9 KB
851 B

django-autohide-help

django-autohide-help is a jQuery plugin packaged as a Django app for easy installation. It's a plugin that allows frontend developers to hide help blocks generated by crispy forms.

Installation

Install using pip:

pip install django-autohide-help

After adding autohide_help to INSTALLED_APPS, autohide-help.js will be avalable at {{ STATIC_URL }}js/autohide-help.js.

If you are using RequireJS_, you can add autohide-help to dependencies, as it is packages with RequireJS support.

If you want to use it via a simple script tag, you can add the script tag as usual:

<script src="{{ STATIC_URL}}js/autohide-help.js``"></script>

This plugin requires jQuery (obviously).

Basic usage

Select a form (or forms), and call autohideHelp on it:

$('form').autohideHelp()

As user enters the fields the help block is slid out, and slid back in as user leaves the field.

Using without crispy forms

Crispy forms are not absolutely required. It is just convenient to use them since they automatically generate the help blocks.

If you want to use django-autohide-help without the crispy forms, make sure that your help blocks have an id in the following format: help_FIELD_ID where FIELD_ID is the id of the field to which the help block belongs. For example, if you field has an id of id_name, the help block must have the id of help_id_name. Future releases of django-authide-help may make this configurable.

Reporting bugs

Please report bugs to Bitbucket issue tracker.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.