From 3cbc435419cfa17fabd9cdbc15d383d539f6b28c Mon Sep 17 00:00:00 2001 From: Yuriy Bakhtin Date: Mon, 4 Mar 2024 15:01:55 +0100 Subject: [PATCH] Fix layout after change page of participants list --- docs/CHANGELOG.md | 1 + .../js/humhub.calendar.participation.Form.js | 28 +++++++++---------- .../humhub.calendar.participation.Form.min.js | 2 +- widgets/views/participantList.php | 1 + 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 1c381e13..19832f7a 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -9,6 +9,7 @@ Changelog - Fix #453: Profile Calendar not available when adding an event from the global Calendar when the module is enabled in the profile - Enh #457: Strikethrough cancelled events in calendar view - Enh #460: Add cancelled status in ICS files +- Fix #402: Fix layout after change page of participants list 1.5.8 (January 19, 2024) ------------------------ diff --git a/resources/js/humhub.calendar.participation.Form.js b/resources/js/humhub.calendar.participation.Form.js index 409a6cfb..ffa3f04d 100644 --- a/resources/js/humhub.calendar.participation.Form.js +++ b/resources/js/humhub.calendar.participation.Form.js @@ -10,6 +10,7 @@ humhub.module('calendar.participation.Form', function (module, require, $) { var client = require('client'); var status = require('ui.status'); var calendar = require('calendar'); + var modal = require('ui.modal'); var Form = Widget.extend(); @@ -32,22 +33,21 @@ humhub.module('calendar.participation.Form', function (module, require, $) { } }); } + } - var $modalBody = $('#globalModal .modal-body'); - $modalBody.on('click', '#calendar-entry-participants-list .pagination a', function (e) { - e.preventDefault(); - e.stopPropagation(); - - var data = $(this).data(); + Form.prototype.changeParticipantsListPage = function (evt) { + var that = this; + evt.preventDefault(); + modal.footerLoader(); - client.get(data.actionUrl).then(function(response) { - var $participantsList = $(response.html).filter('#calendar-entry-participants-list'); - $modalBody.find('#calendar-entry-participants-list').replaceWith($participantsList); - }).catch(function(e) { - module.log.error(e, true); - }).finally(function () { - evt.finish(); - }); + client.get(evt).then(function(response) { + var $participantsList = $(response.html).filter('#calendar-entry-participants-list'); + that.$.find('#calendar-entry-participants-list').replaceWith($participantsList); + }).catch(function(e) { + module.log.error(e, true); + }).finally(function () { + loader.reset(modal.global.getFooter()); + evt.finish(); }); } diff --git a/resources/js/humhub.calendar.participation.Form.min.js b/resources/js/humhub.calendar.participation.Form.min.js index 526ec95c..322e415d 100644 --- a/resources/js/humhub.calendar.participation.Form.min.js +++ b/resources/js/humhub.calendar.participation.Form.min.js @@ -1 +1 @@ -humhub.module("calendar.participation.Form",function(r,t,s){var a=t("ui.widget").Widget,o=t("ui.loader"),c=t("client"),e=t("ui.status"),i=t("calendar"),n=a.extend();n.prototype.init=function(){var a=this;this.saveButton=s("#calendar-entry-participation-button-save"),this.nextButton=s("#calendar-entry-participation-button-next"),this.backButton=s("#calendar-entry-participation-button-back"),this.tabSettings=s("#calendar-entry-participation-tabs li:first"),this.tabParticipants=s("#calendar-entry-participation-tabs li:last"),this.isNewRecord=this.backButton.length,this.isNewRecord&&s("#calendar-entry-participation-tabs li a").click(function(){if(1 $pagination, + 'linkOptions' => ['data' => ['action-click' => 'changeParticipantsListPage']] ]); ?> totalCount) ?>