Permalink
Browse files

Hide/display advanced mass operations (prepend, append, etc.) accordi…

…ng to checkbox status
  • Loading branch information...
1 parent d9f9692 commit edd9104603bc6cf5e1fe5d2158c6194949b76000 @souen souen committed Mar 12, 2012
Showing with 22 additions and 0 deletions.
  1. +22 −0 massadmin/templates/admin/mass_change_form.html
@@ -65,4 +65,26 @@
</div>
</form></div>
+
+<script type="text/javascript">
+ /*
+ * Hide/display advanced mass options (prepend, append, etc.)
+ * according to mass change's checkbox status for each field.
+ */
+ (function($) {
+ $(document).ready( function($) {
+ var mass_fields_cont = $('.js-mass-options');
+ var advanced_select = mass_fields_cont.find('select').hide();
+ mass_fields_cont.find('input[type=checkbox]').bind('click', function() {
+ var $checkbox = $(this);
+ if($checkbox.attr('checked')) {
+ advanced_select.show();
+ } else {
+ advanced_select.hide();
+ }
+ });
+ });
+ })(django.jQuery);
+
+</script>
{% endblock %}

0 comments on commit edd9104

Please sign in to comment.