PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.10
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.10
4.4.10 4.4.9.1 4.4.9 4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 All 142 releases
← All changes | assets/src/apps/js/frontend/single-curriculum/scrolltoitem.js +47 -47 4.3.8 → 4.4.10 View file →
@@ -1,47 +1,47 @@
1 -import lpModalOverlay from '../../utils/lp-modal-overlay';
2 -
3 -const $ = jQuery;
4 -
5 -const scrollToItemCurrent = {
6 - init() {
7 - this.scrollToItemViewing = function() {
8 - const elItemViewing = $( '.viewing-course-item' );
9 - if ( elItemViewing.length ) {
10 - const elCourseCurriculumn = $( '#learn-press-course-curriculum' );
11 - const heightCourseItemContentHeader = $( '#popup-sidebar' ).outerHeight();
12 - const heightSectionTitle = $( '.section-title' ).outerHeight();
13 - const heightSectionHeader = $( '.section-header' ).outerHeight();
14 - const regex = new RegExp( '^viewing-course-item-([0-9].*)' );
15 - const classList = elItemViewing.attr( 'class' );
16 - const classArr = classList.split( /\s+/ );
17 - let idItem = 0;
18 -
19 - $.each( classArr, function( i, className ) {
20 - const compare = regex.exec( className );
21 -
22 - if ( compare ) {
23 - idItem = compare[ 1 ];
24 - return false;
25 - }
26 - } );
27 -
28 - if ( 0 === idItem ) {
29 - return;
30 - }
31 -
32 - const elItemCurrent = $( '.course-item-' + idItem );
33 - elItemCurrent.addClass( 'current' );
34 - const offSetTop = elItemCurrent.offset().top;
35 - const offset = elItemCurrent.offset().top - elCourseCurriculumn.offset().top +
36 - elCourseCurriculumn.scrollTop();
37 -
38 - elCourseCurriculumn.animate( {
39 - scrollTop: LP.Hook.applyFilters( 'scroll-item-current', offset - heightSectionHeader ),
40 - }, 800 );
41 - }
42 - };
43 - this.scrollToItemViewing();
44 - },
45 -};
46 -
47 -export default scrollToItemCurrent;
1 +import lpModalOverlay from '../../utils/lp-modal-overlay';
2 +
3 +const $ = jQuery;
4 +
5 +const scrollToItemCurrent = {
6 + init() {
7 + this.scrollToItemViewing = function() {
8 + const elItemViewing = $( '.viewing-course-item' );
9 + if ( elItemViewing.length ) {
10 + const elCourseCurriculumn = $( '#learn-press-course-curriculum' );
11 + const heightCourseItemContentHeader = $( '#popup-sidebar' ).outerHeight();
12 + const heightSectionTitle = $( '.section-title' ).outerHeight();
13 + const heightSectionHeader = $( '.section-header' ).outerHeight();
14 + const regex = new RegExp( '^viewing-course-item-([0-9].*)' );
15 + const classList = elItemViewing.attr( 'class' );
16 + const classArr = classList.split( /\s+/ );
17 + let idItem = 0;
18 +
19 + $.each( classArr, function( i, className ) {
20 + const compare = regex.exec( className );
21 +
22 + if ( compare ) {
23 + idItem = compare[ 1 ];
24 + return false;
25 + }
26 + } );
27 +
28 + if ( 0 === idItem ) {
29 + return;
30 + }
31 +
32 + const elItemCurrent = $( '.course-item-' + idItem );
33 + elItemCurrent.addClass( 'current' );
34 + const offSetTop = elItemCurrent.offset().top;
35 + const offset = elItemCurrent.offset().top - elCourseCurriculumn.offset().top +
36 + elCourseCurriculumn.scrollTop();
37 +
38 + elCourseCurriculumn.animate( {
39 + scrollTop: LP.Hook.applyFilters( 'scroll-item-current', offset - heightSectionHeader ),
40 + }, 800 );
41 + }
42 + };
43 + this.scrollToItemViewing();
44 + },
45 +};
46 +
47 +export default scrollToItemCurrent;