Skip to content

Fix css rule and remove using jQuery#5

Open
rajniszp wants to merge 2 commits into
AndreaGrandieri:mainfrom
rajniszp:main
Open

Fix css rule and remove using jQuery#5
rajniszp wants to merge 2 commits into
AndreaGrandieri:mainfrom
rajniszp:main

Conversation

@rajniszp

Copy link
Copy Markdown

This PR does two things:

  1. fixes the invalid css rule - there should be no spaces between number and unit
  2. removes the need of jQuery by using the native javascript methods

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an invalid CSS rule by removing spaces between numbers and units, and replaces jQuery usage with native JavaScript methods to eliminate dependencies.

  • Replaces jQuery's outerHeight() method with native getBoundingClientRect().height
  • Fixes CSS spacing issue between numeric values and units

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread MMM-MD.js

// Valore massimo che può assumere "bigWrapper.scrollTop"
maxima = bigWrapper.scrollHeight - $(bigWrapper).outerHeight() + staller;
maxima = bigWrapper.scrollHeight - bigWrapper.getBoundingClientRect().height + staller;

Copilot AI Sep 8, 2025

Copy link

Choose a reason for hiding this comment

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

The replacement of $(bigWrapper).outerHeight() with getBoundingClientRect().height may not be equivalent. jQuery's outerHeight() includes padding, border, and optionally margin, while getBoundingClientRect().height includes padding and border but not margin. Consider using offsetHeight instead for closer equivalence to jQuery's default behavior.

Suggested change
maxima = bigWrapper.scrollHeight - bigWrapper.getBoundingClientRect().height + staller;
maxima = bigWrapper.scrollHeight - bigWrapper.offsetHeight + staller;

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Right. But if you look few lines before, margin is set to 0, and neither padding nor border are set, therefore it doesn't make a difference.

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

Successfully merging this pull request may close these issues.

2 participants