Skip to content

Commit

Permalink
remove arrow functions from client code
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacwhite committed Aug 5, 2019
1 parent f9a9d2b commit 92bad23
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 13 deletions.
41 changes: 30 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions public/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ function refreshHistory(localStorageKey, type, cb) {
// Adds a See More button for category containers with content
// that overflows a max height set in the css
function seeMoreButton() {
$('.children-view').each((_, el) => {
$('.children-view').each(function (_, el) {
var $el = $(el)
var $content = $el.find('.children')
if ($el.height() >= $content.height()) return

$el.parent().append('<button class="seeMore-button">See more</button>')
})

$('#category-page').on('click', '.seeMore-button', (el) => {
$('#category-page').on('click', '.seeMore-button', function (el) {
var $button = $(el.currentTarget)
var text = $button.hasClass('show') ? 'See more' : 'See less'

Expand Down

0 comments on commit 92bad23

Please sign in to comment.