Skip to content

Commit

Permalink
Moar fixes!
Browse files Browse the repository at this point in the history
  • Loading branch information
V13Axel committed Jul 19, 2024
1 parent 59b37f3 commit e36badf
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 24 deletions.
10 changes: 5 additions & 5 deletions resources/views/calendar/_loadcalendar.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
advancement_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
}

window.dispatchEvent(
new CustomEvent('calendar-loaded', {
detail: {
this.$nextTick(
() => this.$dispatch(
'calendar-loaded', {
hash: window.hash,
calendar_name: window.calendar_name,
calendar_id: window.calendar_id,
Expand All @@ -56,5 +56,5 @@
last_dynamic_change: window.last_dynamic_change,
advancement: window.advancement
}
})
)
)
);
2 changes: 1 addition & 1 deletion resources/views/calendar/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<script>
function generatorData() {
return {
init: () => {
init() {
@include('calendar._loadcalendar')
window.preview_date = _.cloneDeep(dynamic_data);
Expand Down
25 changes: 9 additions & 16 deletions resources/views/calendar/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ function generatorData() {
init() {
@include('calendar._loadcalendar')
preview_date = _.cloneDeep(dynamic_data);
preview_date.follow = true;
window.preview_date = _.cloneDeep(dynamic_data);
window.preview_date.follow = true;
set_up_view_inputs();
set_up_view_values();
Expand All @@ -17,14 +17,15 @@ function generatorData() {
bind_calendar_events();
if(!evaluate_queryString(window.location.search)){
rebuild_calendar('calendar', dynamic_data);
rebuild_calendar('calendar', window.dynamic_data);
}else{
rebuild_calendar('calendar', preview_date);
rebuild_calendar('calendar', window.preview_date);
}
$('#current_year, #current_timespan, #current_day, #current_hour, #current_minute, #location_select').change(function(){
do_update_dynamic(hash);
});
$('#current_year, #current_timespan, #current_day, #current_hour, #current_minute, #location_select')
.change(debounce(function(type){
window.update_view_dynamic(window.hash);
}, 500));
last_mouse_move = Date.now();
poll_timer = setTimeout(check_dates, 5000);
Expand All @@ -43,7 +44,7 @@ function generatorData() {
}
window.dispatchEvent(new CustomEvent("events-changed"));
}
},
}
}
Expand Down Expand Up @@ -189,14 +190,6 @@ function check_update(rebuild){
set_up_view_values();
}
document.addEventListener("DOMContentLoaded", function() {
if(typeof debounce !== 'undefined'){
var do_update_dynamic = debounce(function(type){
update_view_dynamic(hash);
}, 500);
}
});
</script>
@endpush

Expand Down
4 changes: 2 additions & 2 deletions resources/views/inputs/sidebar/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@

<div x-show="shouldShow" x-data="{
activeDateAdjustment: @can('advance-date', $calendar) 'current' @else 'preview' @endcan,
shouldShow: false,
shouldShow: window.Perms.player_at_least('co-owner') || window.static_data.settings.allow_view,
calculateShouldShow: function () {
this.shouldShow = window.Perms.player_at_least('co-owner') || static_data.settings.allow_view;
this.shouldShow = window.Perms.player_at_least('co-owner') || window.static_data.settings.allow_view;
},
}" @calendar-loaded.window="calculateShouldShow">
<ul class="nav justify-content-center nav-tabs mx-3 mt-3">
Expand Down

0 comments on commit e36badf

Please sign in to comment.