Skip to content

Commit

Permalink
Additional styles
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickbrown-io committed Jan 18, 2024
1 parent 7d70f4a commit a9829e8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
21 changes: 21 additions & 0 deletions css/ucb-class-notes-list.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,27 @@
text-align: right;
font-size: 85%;
}
.ucb-class-notes-read-more-container{
text-align: center;
}
.ucb-class-notes-read-more{
padding: 5px 10px;
font-weight: bold;
font-family: "Roboto","Helvetica Neue",Helvetica,Arial,sans-serif;
margin-bottom: 5px;
background-clip: padding-box;
color: #0277BD !important;
border: 1px solid #0277BD;
border-radius: 0px;
background-color: transparent;
text-decoration: none;
}

.ucb-class-notes-read-more:hover {
transition: background-color 0.25s ease,border-color 0.25s ease,color 0.25s ease;
background-color: #0277BD;
color: white !important;
}

@media only screen and (max-width: 525px) {
.ucb-class-notes-view-all-container{
Expand Down
13 changes: 6 additions & 7 deletions js/ucb-class-notes-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,18 @@ class ClassNotesListElement extends HTMLElement {
}
// Makes the next button
if(nextURL != ""){
const nextButtonContainer = document.createElement('div')
nextButtonContainer.classList.add('ucb-class-notes-read-more-container')
const nextButton = document.createElement('button');
nextButton.classList.add('ucb-class-notes-read-more');
nextButton.innerText = 'Load More Notes';
nextButton.addEventListener('click', () => {
this.getNextSet(nextURL);
nextButton.remove(); // Remove the button after it's clicked
});

// Append the button to the container or a specific element
this._notesListElement.appendChild(nextButton);
// Append the button to the container, then the element
nextButtonContainer.appendChild(nextButton)
this._notesListElement.appendChild(nextButtonContainer);
}
}
// Used for toggling the error messages/loader on/off
Expand Down Expand Up @@ -203,10 +205,7 @@ class ClassNotesListElement extends HTMLElement {
const year = event.target.value;
const JSONURL = this.getAttribute('base-uri');
const sort = this.getSortValue();
const notesListElement = this._notesListElement
while (notesListElement.firstChild) {
notesListElement.removeChild(notesListElement.firstChild);
}
this.clearNotesList();
this.getData(JSONURL, year, sort);
}
// If a Class Note Year is selected...
Expand Down

0 comments on commit a9829e8

Please sign in to comment.