Skip to content

Commit

Permalink
refactor chevrons for column sort
Browse files Browse the repository at this point in the history
  • Loading branch information
mdickson-adbe committed May 28, 2024
1 parent 3e3da46 commit 5e9110a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions blocks/gmo-campaign-list/gmo-campaign-list.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ body {
.column-sort-wrapper {
display: flex;
flex-direction: column;
justify-content: center;
}
.column-sort-wrapper .icon {
height: 14px;
Expand Down
10 changes: 6 additions & 4 deletions blocks/gmo-campaign-list/gmo-campaign-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,15 @@ function buildListHeaders(headerConfig) {
if (column.sortable) {
const columnSort = document.createElement('div');
columnSort.classList.add('column-sort-wrapper');
const columnSortAsc = document.createElement('span');
columnSortAsc.classList.add('column-sort-asc', 'icon', 'icon-chevronUp');
const columnSortAsc = document.createElement('img');
columnSortAsc.classList.add('column-sort-asc', 'icon');
columnSortAsc.src = '/icons/chevronUp.svg';
columnSortAsc.addEventListener('click', () => {
sortColumn('asc', column.attribute);
})
const columnSortDesc = document.createElement('span');
columnSortDesc.classList.add('column-sort-desc', 'icon', 'icon-chevronDown');
const columnSortDesc = document.createElement('img');
columnSortDesc.classList.add('column-sort-desc', 'icon');
columnSortDesc.src = '/icons/chevronDown.svg';
columnSortDesc.addEventListener('click', () => {
sortColumn('desc', column.attribute);
})
Expand Down

0 comments on commit 5e9110a

Please sign in to comment.