Skip to content

Commit

Permalink
Merge pull request #465 from humhub/fix/402-change-participants-list-…
Browse files Browse the repository at this point in the history
…page

Fix layout after change page of participants list
  • Loading branch information
luke- authored Mar 4, 2024
2 parents 99b1975 + 3cbc435 commit 6a07907
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
------------------------
Expand Down
28 changes: 14 additions & 14 deletions resources/js/humhub.calendar.participation.Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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();
});
}

Expand Down
2 changes: 1 addition & 1 deletion resources/js/humhub.calendar.participation.Form.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions widgets/views/participantList.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<div class="pagination-container">
<?= AjaxLinkPager::widget([
'pagination' => $pagination,
'linkOptions' => ['data' => ['action-click' => 'changeParticipantsListPage']]
]); ?>
<?= Html::hiddenInput('calendar-entry-participants-count', $pagination->totalCount) ?>
</div>
Expand Down

0 comments on commit 6a07907

Please sign in to comment.