[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Calendars: Adjust preview close button behavior and hide calendar_header in preview mode
"ushindi bienvenu \(@usbbush\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6a7ad367f26b4_3919f7f875192@gitlab-sidekiq-low-urgency-cpu-bound-v2-84dcc76b6c-pvdxq.mail> |
ushindi bienvenu pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
18fc7453 by Alvin Bauma at 2026-08-11T07:29:42+00:00
[FIX] Calendars: Adjust preview close button behavior and hide calendar_header in preview mode
---
* rebase
See merge request tikiwiki/tiki!9579
- - - - -
2 changed files:
- lib/jquery_tiki/tiki-calendar_edit_item.js
- templates/calendar/view_item.tpl
Changes:
=====================================
lib/jquery_tiki/tiki-calendar_edit_item.js
=====================================
@@ -169,6 +169,7 @@ function handleEditCalendarItem() {
if (btnName === "preview") {
// also used when changing calendars to reload the form
var $disabled = $form.find('select:disabled');
+ $form.find("#act").val("preview");
$disabled.removeAttr('disabled');
var params = $form.serialize();
$disabled.attr('disabled', 'disabled');
@@ -271,6 +272,7 @@ function handleEditCalendarItem() {
};
const previewExecutor = delayedExecutor(500, function ($form) {
+ $form.find("#act").val("preview");
$.post(
$.service("calendar", "view_item"),
$form.serialize(),
@@ -299,10 +301,16 @@ function handleEditCalendarItem() {
});
$(document).on("click", ".edit-event-form .preview .btn-close", function () {
+ // slideUp() (jQuery core, called just below) is what adds the inline style
+ // removed here: it animates height/overflow via inline styles and, on
+ // completion, leaves style="display: none;" on the element. Nothing else
+ // in this codebase sets an inline style on .preview, so removeAttr("style")
+ // fully undoes slideUp()'s effect, restoring the element to its initial
+ // "d-none" (class-only) hidden state instead of mixing it with an inline style.
$(this).closest(".preview").slideUp(
function () {
// put it back to how it was on page load
- $(this).show().addClass("d-none");
+ $(this).removeAttr("style").addClass("d-none");
}
);
});
=====================================
templates/calendar/view_item.tpl
=====================================
@@ -13,6 +13,8 @@
{/if}
{if not $preview}
+ {include file='calendar_header.tpl' viewlist='listEventView'}
+
<div class="float-end">
{permission name='change_events' type='calendaritem' object=$calitem.calitemId}
<a href="{service controller='calendar' action='edit_item' calitemId=$calitem.calitemId|escape}" class="btn btn-primary edit-calendar-item-btn">
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/18fc74531e67405bb7ec3c75698d7b23acaeda26
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/18fc74531e67405bb7ec3c75698d7b23acaeda26
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs