Skip to content

Commit

Permalink
assets/js/lesson.js: use .length instead of .size()
Browse files Browse the repository at this point in the history
.size() was deprecated in jQuery 3.0 in favor of .length attribute.
https://jquery.com/upgrade-guide/3.0/#breaking-change-deprecated-size-removed

Co-Authored-By: Thomas Green <[email protected]>
  • Loading branch information
maxim-belkin and tomgreen66 committed Jul 6, 2020
1 parent 5d4aaa2 commit 3001ab5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assets/js/lesson.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ $("table").addClass("table table-striped");

// Handle foldable challenges and solutions (on click and at start).
$(".solution").click(function(event) {
var trigger = $(event.target).has(".fold-unfold").size() > 0
|| $(event.target).filter(".fold-unfold").size() > 0;
var trigger = $(event.target).has(".fold-unfold").length > 0
|| $(event.target).filter(".fold-unfold").length > 0;
if (trigger) {
$(">*:not(h2)", this).toggle(400);
$(">h2>span.fold-unfold", this).toggleClass("glyphicon-collapse-down glyphicon-collapse-up");
Expand Down

0 comments on commit 3001ab5

Please sign in to comment.