Skip to content

Commit af5cd63

Browse files
committed
Reapply "Refactored list-feature.js"
This reverts commit 9b386bb.
1 parent 20507f9 commit af5cd63

File tree

3 files changed

+22
-25
lines changed

3 files changed

+22
-25
lines changed

djangoproject/static/js/djangoproject.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,25 @@ document.querySelectorAll('.console-block label').forEach(function (el) {
3434
});
3535
});
3636
});
37+
38+
// Add animation class to feature icons when they are fully visible
39+
(function () {
40+
const observer = new IntersectionObserver(
41+
function (entries) {
42+
entries.forEach(function (entry) {
43+
if (!entry.isIntersecting) {
44+
return;
45+
}
46+
47+
entry.target.classList.add('inview');
48+
49+
observer.unobserve(entry.target);
50+
});
51+
},
52+
{ threshold: 1.0 },
53+
);
54+
55+
document.querySelectorAll('.list-features i').forEach(function (el) {
56+
observer.observe(el);
57+
});
58+
})();

djangoproject/static/js/main.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ define(function () {
99
return !!document.getElementsByClassName(className).length; //return a boolean
1010
}
1111

12-
//feature list
13-
if (hasClass('list-features')) {
14-
mods.push('mod/list-feature');
15-
}
16-
1712
//collapsing list
1813
if (hasClass('list-collapsing')) {
1914
mods.push('mod/list-collapsing');

djangoproject/static/js/mod/list-feature.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)