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

[Traffic Register] View PDF Buttons CSS Styling & JQuery Functionality #187

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ChrispinP
Copy link
Member

@ChrispinP ChrispinP commented Feb 17, 2025

For #20611

Using the same styling as the View PDF buttons for generated PDF's stored in PowerBI, we create View PDF buttons for historical PDF's stored in SharePoint. We use a blue outline for these historical buttons to create distinction.

image

New with JQuery:
image

@ChrispinP ChrispinP added enhancement Enhancement to an existing feature or app CSS Modified CSS code Knack Any Knack related PR's labels Feb 17, 2025
@ChrispinP ChrispinP self-assigned this Feb 17, 2025
@ChrispinP ChrispinP changed the title Add Historical View PDF Buttons [Traffic Register] Add Historical View PDF Buttons CSS Feb 17, 2025
Copy link
Contributor

@susannegov susannegov left a comment

Choose a reason for hiding this comment

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

The border-color:#dd4d4d; min-width: 190px !important; max-width: 27% !important; declarations for the div.kn-detail:hover is redundant unless the declarations between the div.kn-detail and the div.kn-detail:hover has changed. I tested this in my sandbox with the declarations removed from hover to confirm.

  • line 461
  • line 467
  • line 473
  • line 479

I would remove the 3 declarations from the hover css to make it easier to maintain.

@susannegov
Copy link
Contributor

Also the official name is "Power BI" (with space) not "PowerBI" (no space).

Also added space for Power BI so its pretty
@ChrispinP ChrispinP requested a review from susannegov February 20, 2025 18:59
Copy link
Contributor

@susannegov susannegov left a comment

Choose a reason for hiding this comment

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

🚀

Target the specific field div instead of the view to apply stylings and make the entire button clickable without underline
JQuery to add css class to link, wrap the div, and add click event making the entire button clickable. Done for both Power BI link field and SharePoint link field.
@ChrispinP ChrispinP changed the title [Traffic Register] Add Historical View PDF Buttons CSS [Traffic Register] View PDF Buttons CSS Styling & JQuery Functionality Feb 21, 2025
/* #kn-scene_773 #view_1705 div.kn-detail { padding: 1px 2px; border-style: solid; border-width: 1px; border-color: #163f6e; border-radius: 8px;
box-shadow: 0px 0px 0px 0px gray; font-size: 1.25em; background-color: #ebebeb; color: #163f6e; text-align: left; min-width: 190px !important; max-width: 27% !important; }
#kn-scene_773 #view_1705 div.kn-detail:hover { opacity: 0.9; cursor: pointer; border-color: #163f6e; border-width: 2px; }
#kn-scene_773 #view_1705 .kn-detail-label { background-color: transparent; min-width: 0% !important; } */

Copy link
Member Author

Choose a reason for hiding this comment

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

Previous 4 code blocks above have been commented out with the 2 new code blocks under the 'Style PDF Link Fields as Buttons' section

@ChrispinP
Copy link
Member Author

4th Commit now include the JS file for the JQuery updates. Please re-review, thanks 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Modified CSS code enhancement Enhancement to an existing feature or app Knack Any Knack related PR's
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants