summaryrefslogtreecommitdiff
path: root/static/admin/js/change_form.js
diff options
context:
space:
mode:
authorSashi202020-02-20 12:58:59 +0530
committerSashi202020-02-20 12:58:59 +0530
commit1fb3d381e832d5c5871c6cb2fd8b2c1ae3dbd029 (patch)
tree3a9829196102efdf509fe50b5458237966999ecf /static/admin/js/change_form.js
parent802bbc270363d1432cb28cd88d6c9003d8b99b6c (diff)
downloadarduino_projects_website-1fb3d381e832d5c5871c6cb2fd8b2c1ae3dbd029.tar.gz
arduino_projects_website-1fb3d381e832d5c5871c6cb2fd8b2c1ae3dbd029.tar.bz2
arduino_projects_website-1fb3d381e832d5c5871c6cb2fd8b2c1ae3dbd029.zip
Add user registration, login and abstract submission interfaces
Diffstat (limited to 'static/admin/js/change_form.js')
-rw-r--r--static/admin/js/change_form.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/static/admin/js/change_form.js b/static/admin/js/change_form.js
new file mode 100644
index 0000000..4797383
--- /dev/null
+++ b/static/admin/js/change_form.js
@@ -0,0 +1,20 @@
+/*global showAddAnotherPopup, showRelatedObjectLookupPopup showRelatedObjectPopup updateRelatedObjectLinks*/
+
+(function($) {
+ 'use strict';
+ $(document).ready(function() {
+ var modelName = $('#django-admin-form-add-constants').data('modelName');
+ $('body').on('click', '.add-another', function(e) {
+ e.preventDefault();
+ var event = $.Event('django:add-another-related');
+ $(this).trigger(event);
+ if (!event.isDefaultPrevented()) {
+ showAddAnotherPopup(this);
+ }
+ });
+
+ if (modelName) {
+ $('form#' + modelName + '_form :input:visible:enabled:first').focus();
+ }
+ });
+})(django.jQuery);