Hide calendar shortcuts when input is disabled
[ais.git] / www_templates / fragment_vessel_history.html
index 54c53e170cf7eabf7df12a7e69b3b085b5b3d577..9d8d634455626b48c3bacd9f7aecee021c29b421 100644 (file)
@@ -4,24 +4,32 @@
 function show_hide_start_end_time(value) {
     if (value=='duration') {
         $('#id_start_date').attr('disabled', 'disabled');
+        $('#spancalshort_0').hide();
         $('#id_duration_0').removeAttr('disabled');
         $('#id_duration_1').removeAttr('disabled');
         $('#id_end_date').attr('disabled', 'disabled');
+        $('#spancalshort_1').hide();
     } else if (value=='date_date') {
         $('#id_start_date').removeAttr('disabled');
+        $('#spancalshort_0').show();
         $('#id_duration_0').attr('disabled', 'disabled');
         $('#id_duration_1').attr('disabled', 'disabled');
         $('#id_end_date').removeAttr('disabled');
+        $('#spancalshort_1').show();
     } else if (value=='start_duration') {
         $('#id_start_date').removeAttr('disabled');
+        $('#spancalshort_0').show();
         $('#id_duration_0').removeAttr('disabled');
         $('#id_duration_1').removeAttr('disabled');
         $('#id_end_date').attr('disabled', 'disabled');
+        $('#spancalshort_1').hide();
     } else {
         $('#id_start_date').attr('disabled', 'disabled');
+        $('#spancalshort_0').hide(); /* usually not ready yet */
         $('#id_duration_0').attr('disabled', 'disabled');
         $('#id_duration_1').attr('disabled', 'disabled');
         $('#id_end_date').attr('disabled', 'disabled');
+        $('#spancalshort_1').hide(); /* usually not ready yet */
     }
 }
 $(document).ready(function () {