Нет описания

action_formats.js 765B

1234567891011121314151617181920212223
  1. (function($) {
  2. $(document).ready(function() {
  3. var $actionsSelect, $formatsElement;
  4. if ($('body').hasClass('grp-change-list')) {
  5. // using grappelli
  6. $actionsSelect = $('#grp-changelist-form select[name="action"]');
  7. $formatsElement = $('#grp-changelist-form select[name="file_format"]');
  8. } else {
  9. // using default admin
  10. $actionsSelect = $('#changelist-form select[name="action"]');
  11. $formatsElement = $('#changelist-form select[name="file_format"]').parent();
  12. }
  13. $actionsSelect.change(function() {
  14. if ($(this).val() === 'export_admin_action') {
  15. $formatsElement.show();
  16. } else {
  17. $formatsElement.hide();
  18. }
  19. });
  20. $actionsSelect.change();
  21. });
  22. })(django.jQuery);