aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2019-07-08 21:12:54 +0200
committerMario Vavti <mario@mariovavti.com>2019-07-08 21:12:54 +0200
commit02c08aed12071b41514236701de5fd6034d2dcba (patch)
tree91ba9269abee58b285341abb1ca8a0d0be618075 /view
parent87668f7fa8b22526918463bda7602d138385cc35 (diff)
downloadvolse-hubzilla-02c08aed12071b41514236701de5fd6034d2dcba.tar.gz
volse-hubzilla-02c08aed12071b41514236701de5fd6034d2dcba.tar.bz2
volse-hubzilla-02c08aed12071b41514236701de5fd6034d2dcba.zip
hide timezone select on allday events
Diffstat (limited to 'view')
-rw-r--r--view/tpl/cdav_calendar.tpl22
-rw-r--r--view/tpl/field_select_grouped.tpl2
2 files changed, 20 insertions, 4 deletions
diff --git a/view/tpl/cdav_calendar.tpl b/view/tpl/cdav_calendar.tpl
index 252d45cff..c44a3faab 100644
--- a/view/tpl/cdav_calendar.tpl
+++ b/view/tpl/cdav_calendar.tpl
@@ -69,6 +69,14 @@ $(document).ready(function() {
allday = info.allDay;
+ if(allday) {
+ $('#id_dtstart_wrapper, #id_dtend_wrapper, #id_timezone_select_wrapper').hide();
+ }
+ else {
+ $('#id_dtstart_wrapper, #id_dtend_wrapper, #id_timezone_select_wrapper').show();
+ }
+
+
var dtend = new Date(info.date.toUTCString());
if(allday) {
dtend.setDate(dtend.getDate() + 1);
@@ -114,6 +122,13 @@ $(document).ready(function() {
$('#l2s').remove();
}
+ if(event.allDay) {
+ $('#id_dtstart_wrapper, #id_dtend_wrapper, #id_timezone_select_wrapper').hide();
+ }
+ else {
+ $('#id_dtstart_wrapper, #id_dtend_wrapper, #id_timezone_select_wrapper').show();
+ }
+
if(event.publicId == new_event_id) {
$('#calendar_select').trigger('change');
$('#event_submit').show();
@@ -366,20 +381,21 @@ $(document).ready(function() {
}
if(default_view === 'dayGridMonth');
- $('#id_dtstart_wrapper, #id_dtend_wrapper').hide();
+ $('#id_dtstart_wrapper, #id_dtend_wrapper, #id_timezone_select_wrapper').hide();
});
function changeView(viewName) {
+
calendar.changeView(viewName);
$('#title').text(calendar.view.title);
$('#view_selector').html(views[calendar.view.type]);
if(viewName === 'dayGridMonth') {
- $('#id_dtstart_wrapper, #id_dtend_wrapper').hide();
+ $('#id_dtstart_wrapper, #id_dtend_wrapper, #id_timezone_select_wrapper').hide();
}
else {
- $('#id_dtstart_wrapper, #id_dtend_wrapper').show();
+ $('#id_dtstart_wrapper, #id_dtend_wrapper, #id_timezone_select_wrapper').show();
}
return;
diff --git a/view/tpl/field_select_grouped.tpl b/view/tpl/field_select_grouped.tpl
index e6d1479de..ec067b8e7 100644
--- a/view/tpl/field_select_grouped.tpl
+++ b/view/tpl/field_select_grouped.tpl
@@ -1,4 +1,4 @@
- <div class='form-group field select'>
+ <div id='id_{{$field.0}}_wrapper' class='form-group field select'>
<label for='id_{{$field.0}}'>{{$field.1}}</label>
<select class="form-control" name='{{$field.0}}' id='id_{{$field.0}}'>
{{foreach $field.4 as $group=>$opts}}