Skip to content

Commit

Permalink
This commit changes the usage of sticky-kit.js inside financial-view.js.
Browse files Browse the repository at this point in the history
It now turns sticky-kit off when the screen size is less than or equal to
600px. In this way, it prevents sticky-kit from interfering with the page
when it's in its small screen view, which prevents a scrolling bug from
occurring.
  • Loading branch information
mistergone committed Aug 18, 2017
1 parent fa2aa5c commit 8238c98
Show file tree
Hide file tree
Showing 10 changed files with 8,614 additions and 3,586 deletions.
12,171 changes: 8,595 additions & 3,576 deletions npm-shrinkwrap.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,4 @@ margin: 0.5cm;
zoom: 1;
*display: inline;
padding-top: 0.25em;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -487,4 +487,4 @@ The sharing module differs from others on the site.
/* Tweak external link icon to match existing link color. */
.icon-external-link {
color: #4d819a;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -676,4 +676,4 @@ This has similar styles as the global site navigation.
zoom: 1;
*display: inline;
padding-top: 0.25em;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,4 @@ margin: 0.5cm;
zoom: 1;
*display: inline;
padding-top: 0.25em;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2141,4 +2141,4 @@ a img.aligncenter {
display: block;
margin-left: auto;
margin-right: auto
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -487,4 +487,4 @@ The sharing module differs from others on the site.
/* Tweak external link icon to match existing link color. */
.icon-external-link {
color: #4d819a;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -676,4 +676,4 @@ This has similar styles as the global site navigation.
zoom: 1;
*display: inline;
padding-top: 0.25em;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,4 @@ margin: 0.5cm;
zoom: 1;
*display: inline;
padding-top: 0.25em;
}
}
13 changes: 11 additions & 2 deletions src/disclosures/js/views/financial-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -804,14 +804,23 @@ var financialView = {
* if the summaries are in the inline-block sidebar column
*/
stickySummariesListener: function() {
var $stickyOffers = $( '.offer-part_summary-wrapper' );
$stickyOffers.stick_in_parent()
var $stickyOffers = $( '.offer-part_summary-wrapper' ),
$win = $(window);
if ( $win.width() >= 600 ) {
$stickyOffers.stick_in_parent()
.on( 'sticky_kit:bottom', function( evt ) {
$( evt.target ).addClass( 'is_bottomed' );
} )
.on( 'sticky_kit:unbottom', function( evt ) {
$( evt.target ).removeClass( 'is_bottomed' );
} );
} else {
$stickyOffers.trigger( 'sticky_kit:detach' );
}

$win.resize( function() {
financialView.stickySummariesListener();
} );
},

/**
Expand Down

0 comments on commit 8238c98

Please sign in to comment.