Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / js / kivi.CustomDataExportDesigner.js
diff --git a/js/kivi.CustomDataExportDesigner.js b/js/kivi.CustomDataExportDesigner.js
new file mode 100644 (file)
index 0000000..53e8953
--- /dev/null
@@ -0,0 +1,13 @@
+namespace('kivi.CustomDataExportDesigner', function(ns){
+  'use strict';
+
+  ns.enable_default_value = function() {
+    var count = $(this).prop('id').replace("default_value_type_", "");
+    var type  = $(this).val();
+    $('#default_value_' + count).prop('disabled', (type === 'none') || (type === 'current_user_login'));
+  };
+});
+
+$(function() {
+  $('[id^="default_value_type_"]').change(kivi.CustomDataExportDesigner.enable_default_value);
+});