Skip to content
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

Incorrect display when there are many products on the page #3

Open
cregx opened this issue Jun 6, 2021 · 1 comment
Open

Incorrect display when there are many products on the page #3

cregx opened this issue Jun 6, 2021 · 1 comment

Comments

@cregx
Copy link

cregx commented Jun 6, 2021

The original has 8 products which can be compared.
If I add more products, then there is an incorrect pagination in the display (see attached screenshot).
(Tested in Google Chrome Version 91.0.4472.77 and Safari Version 14.1.1)

2021-06-06 um 08 11 26

The problem is not noticeable when resized the browser window.
I have currently corrected the problem via main.js as follows:

jQuery(document).ready(function($){

      // Fix #1: Prevent automatic pagination when displaying many products.
      var myValues = {};

      function productsTable( element ) {
         this.element = element;
         this.table = this.element.children('.cd-products-table');
         ...
         
         // Fix #1:
	 myValues.updatedColumnsWidth = this.productWidth * this.productsNumber;
      }
      ...
      
      // Fix #1:
      $(".cd-products-columns").css('width', myValues.updatedColumnsWidth + 'px')
});

Otherwise, it only remains for me to say that "products-comparison-table" is a great solution 👍. Many thanks for that!
Best regards cregx

@ComposingGloves
Copy link

Your solution worked great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants