Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/static/css/createEvent.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@
background-color: #fff
}

.fixedButton {
position: fixed;
right: 1.5rem;
bottom: 1.5rem;
}
21 changes: 20 additions & 1 deletion app/static/js/createEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,23 @@ function verifyRepeatingFields(){
return isEmpty
}

/*
* Update the position of the Save button so that it is always on the screen as
* the window scrolls and changes size. The position on the screen is determined
* in the fixedButton class */
const saveBtn = $('#saveButton');
function updateSavePosition() {
const originalTop = saveBtn.parent()[0].getBoundingClientRect().top; // relative to scroll
const buttonHeight = 40;

if ($(window).height() < originalTop + buttonHeight) {
saveBtn.addClass('fixedButton');
} else {
saveBtn.removeClass('fixedButton');
}
}
$(window).on('scroll resize load', updateSavePosition);

$('#saveSeries').on('click', function(e) {
e.preventDefault(); // Prevent default form submission at the start
enableLiveCustomValidityClearing([".multipleOfferingNameField"])
Expand Down Expand Up @@ -393,6 +410,9 @@ function updateOfferingsTable() {
"</tr>"
);
});

//recalculate the save button
updateSavePosition()
}

//visual date formatting for multi-event table
Expand Down Expand Up @@ -803,4 +823,3 @@ function handleTimeFormatting(timeArray){




2 changes: 1 addition & 1 deletion app/templates/events/createEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ <h1 id="pageTitle">{{page_title}}</h1>
<button type="button" class="btn btn-success" data-bs-toggle="modal" data-bs-target="#renewWarning">Renew
Event</button>
{% endif %}
<input type="button" class="btn btn-primary saveBtn" id="saveButton" value="Save" />
<input type="button" class="btn btn-primary" id="saveButton" value="Save" />
</div>
</div>
</div>
Expand Down