src/pyams_portal/resources/js/portal.js
changeset 286 9677eb0fc872
parent 275 36ff0ccd4253
--- a/src/pyams_portal/resources/js/portal.js	Fri Mar 19 10:50:57 2021 +0100
+++ b/src/pyams_portal/resources/js/portal.js	Fri Mar 19 11:53:42 2021 +0100
@@ -15,6 +15,26 @@
 		},
 
 		/**
+		 * Templates configuration properties
+		 */
+		configuration: {
+
+			handleChange: true,
+
+			resetTemplate: function(event) {
+				PyAMS_portal.configuration.handleChange = false;
+			},
+
+			setSharedTemplate: function(event) {
+				if (PyAMS_portal.configuration.handleChange) {
+					var form = $(event.target).parents('form');
+					$('input[name="template_mode"]', form).val(['shared']);
+				}
+				PyAMS_portal.configuration.handleChange = true;
+			}
+		},
+
+		/**
 		 * Templates management
 		 */
 		template: {