Skip to content

Commit

Permalink
Make scroll-up increase the font size and scroll-down decrease it (co…
Browse files Browse the repository at this point in the history
…mpiler-explorer#6705)

Just feels more natural
  • Loading branch information
OfekShilon authored Jul 23, 2024
1 parent 2aa1101 commit 2055f08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions static/widgets/fontscale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ function makeFontSizeDropdown(elem: JQuery, obj: FontScale, buttonDropdown: JQue
buttonDropdown.on('wheel', (e: any) => {
e.preventDefault();
let selectedId = elem.find('.active').index();
if (e.originalEvent.deltaY >= 0 && selectedId < elem.children().length - 1) {
if (e.originalEvent.deltaY < 0 && selectedId < elem.children().length - 1) {
selectedId++;
} else if (e.originalEvent.deltaY < 0 && selectedId > 0) {
} else if (e.originalEvent.deltaY >= 0 && selectedId > 0) {
selectedId--;
}
elem.children().eq(selectedId).trigger('click');
Expand Down

0 comments on commit 2055f08

Please sign in to comment.