Skip to content

OD-537 [Fix] Background scrolling in LFD #595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions js/build.templates.js

Large diffs are not rendered by default.

190 changes: 95 additions & 95 deletions js/interface.templates.js

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions js/layout-javascript/agenda-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,8 @@ DynamicList.prototype.attachObservers = function() {
}

beforeOpen.then(function() {
_this.$container.find('.new-agenda-list-container, .dynamic-list-add-item').addClass('hidden');

Fliplet.Analytics.trackEvent({
category: 'list_dynamic_' + _this.data.layout,
action: 'entry_open',
Expand All @@ -601,8 +603,6 @@ DynamicList.prototype.attachObservers = function() {
return;
}

_this.$container.find('.new-agenda-list-container, .dynamic-list-add-item').addClass('hidden');

_this.showDetails(entryId);
Fliplet.Page.Context.update({
dynamicListOpenId: entryId
Expand Down Expand Up @@ -1774,6 +1774,7 @@ DynamicList.prototype.animateDateForward = function($nextDateElement, nextDateEl
// animates cards forward
DynamicList.prototype.animateAgendaForward = function(nextAgendaElement, nextAgendaElementWidth) {
var _this = this;
var $dayHolders = _this.$container.find('.agenda-list-day-holder');

return new Promise(function(resolve) {
_this.$container.find('.agenda-cards-wrapper').animate({
Expand All @@ -1782,7 +1783,7 @@ DynamicList.prototype.animateAgendaForward = function(nextAgendaElement, nextAge
_this.ANIMATION_SPEED,
'swing', // animation easing
function() {
_this.$container.find('.agenda-list-day-holder.active').removeClass('active');
$dayHolders.removeClass('active').not(nextAgendaElement).addClass('hidden');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain how this fix works and why it's necessary

nextAgendaElement.addClass('active');

_this.scrollValue = $(this).scrollLeft();
Expand Down Expand Up @@ -1824,6 +1825,7 @@ DynamicList.prototype.animateDateBack = function($prevDateElement, prevDateEleme
// animate cards back
DynamicList.prototype.animateAgendaBack = function(prevAgendaElement, prevAgendaElementWidth) {
var _this = this;
var $dayHolders = _this.$container.find('.agenda-list-day-holder');

return new Promise(function(resolve) {
_this.$container.find('.agenda-cards-wrapper').animate({
Expand All @@ -1832,7 +1834,7 @@ DynamicList.prototype.animateAgendaBack = function(prevAgendaElement, prevAgenda
_this.ANIMATION_SPEED,
'swing', // animation easing
function() {
_this.$container.find('.agenda-list-day-holder.active').removeClass('active');
$dayHolders.removeClass('active').not(prevAgendaElement).addClass('hidden');
prevAgendaElement.addClass('active');

_this.scrollValue = $(this).scrollLeft();
Expand Down
6 changes: 3 additions & 3 deletions js/layout-javascript/news-feed-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@ DynamicList.prototype.attachObservers = function() {
}

beforeOpen.then(function() {
$el.parents('.new-news-feed-list-container').addClass('hidden');
_this.$container.find('.dynamic-list-add-item').addClass('hidden');

Fliplet.Analytics.trackEvent({
category: 'list_dynamic_' + _this.data.layout,
action: 'entry_open',
Expand All @@ -347,9 +350,6 @@ DynamicList.prototype.attachObservers = function() {

// find the element to expand and expand it
if (_this.allowClick) {
$el.parents('.new-news-feed-list-container').addClass('hidden');
_this.$container.find('.dynamic-list-add-item').addClass('hidden');

_this.showDetails(entryId);
Fliplet.Page.Context.update({
dynamicListOpenId: entryId
Expand Down
6 changes: 3 additions & 3 deletions js/layout-javascript/simple-list-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ DynamicList.prototype.attachObservers = function() {
}

beforeOpen.then(function() {
$el.parents('.simple-list-container').addClass('hidden');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary as part of the solution?

_this.$container.find('.dynamic-list-add-item').addClass('hidden');

Fliplet.Analytics.trackEvent({
category: 'list_dynamic_' + _this.data.layout,
action: 'entry_open',
Expand All @@ -322,9 +325,6 @@ DynamicList.prototype.attachObservers = function() {
return;
}

$el.parents('.simple-list-container').addClass('hidden');
_this.$container.find('.dynamic-list-add-item').addClass('hidden');

_this.showDetails(entryId);
Fliplet.Page.Context.update({
dynamicListOpenId: entryId
Expand Down
9 changes: 9 additions & 0 deletions js/layout-javascript/small-card-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@ DynamicList.prototype.attachObservers = function() {
}

beforeOpen.then(function() {
_this.$container.find('.new-small-card-list-container').addClass('hidden');
_this.$container.find('.dynamic-list-add-item').addClass('hidden');

$el.parents('.small-card-list-wrapper').addClass('hidden');

Fliplet.Analytics.trackEvent({
category: 'list_dynamic_' + _this.data.layout,
action: 'entry_open',
Expand Down Expand Up @@ -1869,6 +1874,7 @@ DynamicList.prototype.addDetailViewData = function(entry) {

if (_.isArray(entry.entryDetails) && entry.entryDetails.length) {
_this.Utils.Record.assignImageContent(_this, entry);

return entry;
}

Expand Down Expand Up @@ -2028,6 +2034,8 @@ DynamicList.prototype.showDetails = function(id, listData) {
var template = Handlebars.compile(data.src || src);
var wrapperTemplate = Handlebars.compile(wrapper);

$('.fl-page-content-wrapper').parent().css('overflow', 'hidden');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain why this isn't simply $('body')


// This bit of code will only be useful if this component is added inside a Fliplet's Accordion component
if (_this.$container.parents('.panel-group').not('.filter-overlay').length) {
_this.$container.parents('.panel-group').not('.filter-overlay').addClass('remove-transform');
Expand Down Expand Up @@ -2075,6 +2083,7 @@ DynamicList.prototype.closeDetails = function() {
Fliplet.Page.Context.remove('dynamicListOpenId');
$overlay.removeClass('open');
_this.$container.find('.new-small-card-list-container').removeClass('overlay-open');
$('.fl-page-content-wrapper').parent().css('overflow', 'auto');

setTimeout(function() {
$overlay.removeClass('ready');
Expand Down
7 changes: 7 additions & 0 deletions js/layout-javascript/small-h-card-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ DynamicList.prototype.attachObservers = function() {
}

beforeOpen.then(function() {
$(event.target).parents('.small-h-card-list-wrapper').addClass('hidden');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please explain why this isn't _this.$container.find('.small-h-card-list-wrapper')

_this.$container.find('.dynamic-list-add-item').addClass('hidden');

Fliplet.Analytics.trackEvent({
category: 'list_dynamic_' + _this.data.layout,
action: 'entry_open',
Expand Down Expand Up @@ -750,6 +753,7 @@ DynamicList.prototype.addDetailViewData = function(entry) {

if (_.isArray(entry.entryDetails) && entry.entryDetails.length) {
_this.Utils.Record.assignImageContent(_this, entry);

return entry;
}

Expand Down Expand Up @@ -907,6 +911,8 @@ DynamicList.prototype.showDetails = function(id, listData) {
var template = Handlebars.compile(data.src || src);
var wrapperTemplate = Handlebars.compile(wrapper);

$('.fl-page-content-wrapper').parent().css('overflow', 'hidden');

// This bit of code will only be useful if this component is added inside a Fliplet's Accordion component
if (_this.$container.parents('.panel-group').not('.filter-overlay').length) {
_this.$container.parents('.panel-group').not('.filter-overlay').addClass('remove-transform');
Expand Down Expand Up @@ -952,6 +958,7 @@ DynamicList.prototype.closeDetails = function() {
Fliplet.Page.Context.remove('dynamicListOpenId');
$overlay.removeClass('open');
_this.$container.find('.new-small-h-card-list-container').removeClass('overlay-open');
$('.fl-page-content-wrapper').parent().css('overflow', 'auto');

setTimeout(function() {
$overlay.removeClass('ready');
Expand Down