Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Full-page modal, add class name to body tag #1180

Conversation

Blackbaud-BrandonJones
Copy link
Contributor

blackbaud/skyux-lib-help#12

The x button was hidden on full page modals, according to UX the Invoker tab should be hidden on full page modals only.

Added a full page body class for full page modals, hiding the help invoker on full page modals

/deep/
.sky-modal-body-full-page {
// Hide the bb-Help-invoker when a full-page modal is present and the widget is closed.
#bb-help-container.closed > #bb-help-invoker {

Choose a reason for hiding this comment

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

The style overwrite should be added to the help library, to keep things separated. This branch should only be concerned with adding the "full page" body class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I disagree, the help widget shouldn't care about the SKY UX style requirements. This would be an example of SKY UX setting a style requirement override for using an element from this library, and should handle that override itself. If SKY were to suddenly change it's style requirements or UX requirements, it wouldn't make sense to have to update a third party library to accommodate that change. It should be agnostic and unaware of SKY.

@blackbaud-sky-savage
Copy link
Collaborator

Tests passed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 8dd19b9
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/284298254

(Please note that this is a fully automated comment.)

@codecov-io
Copy link

codecov-io commented Oct 6, 2017

Codecov Report

Merging #1180 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1180   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files         355     355           
  Lines        6604    6622   +18     
  Branches      852     853    +1     
======================================
+ Hits         6604    6622   +18
Impacted Files Coverage Δ
src/modules/modal/modal-host.service.ts 100% <100%> (ø) ⬆️
src/modules/modal/modal-host.component.ts 100% <100%> (ø) ⬆️
src/modules/modal/modal-adapter.service.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b1c891...de3d5d3. Read the comment docs.

@blackbaud-sky-savage
Copy link
Collaborator

Tests passed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 8ea6edd
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/284333022

(Please note that this is a fully automated comment.)

@Blackbaud-SteveBrush Blackbaud-SteveBrush changed the title Bugfix: hide invoker on full page modals. Full-page modal, add class name to body tag Oct 6, 2017
public setPageScroll(isAdd: boolean, isFullPage: boolean): void {
const modalBodyClasses = ['sky-modal-body-open'];

if (isFullPage) {

Choose a reason for hiding this comment

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

The logic here needs to be refined. Think of this example:

  • User opens full-page modal, so isFullPage is true. The full-page CSS class is added.
  • User opens another full-page modal, so isFullPage is true. The full-page CSS class is added (though not really because it already exists in the body.classList).
  • User closes the second full-page modal, so isFullPage is true. The full-page CSS class is removed.
  • There is now a full-page modal still open but no full-page CSS class on the body element.

You'll need to track the count of full-page modals separately from the count of all modals and only remove the full-page CSS class when the last full-page modal is closed.

Choose a reason for hiding this comment

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

To add to Paul's comments, I feel like this method is not the best place to be adding unrelated body classes since it's specialized for a specific purpose.

// https://bugzilla.mozilla.org/show_bug.cgi?id=814014
modalBodyClasses.forEach(bodyClass => {
document.body.classList.add(bodyClass);
});

Choose a reason for hiding this comment

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

You could avoid the loops and the classList entirely by using Angular's Renderer2.addClass method. https://angular.io/api/core/Renderer2

document.body.classList.remove(modalClass);
modalBodyClasses.forEach(bodyClass => {
document.body.classList.remove(bodyClass);
});

Choose a reason for hiding this comment

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

Same here, but with removeClass.

@blackbaud-sky-savage
Copy link
Collaborator

Tests failed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: f19d23d
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/285592115

(Please note that this is a fully automated comment.)

@blackbaud-sky-savage
Copy link
Collaborator

Tests failed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: bef2785
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/285604464

(Please note that this is a fully automated comment.)

@blackbaud-sky-savage
Copy link
Collaborator

Tests failed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: be58f8a
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/285612819

(Please note that this is a fully automated comment.)

@blackbaud-sky-savage
Copy link
Collaborator

Tests failed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: c81020d
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/285626284

(Please note that this is a fully automated comment.)

@blackbaud-sky-savage
Copy link
Collaborator

Tests failed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: bb9be96
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/285643083

(Please note that this is a fully automated comment.)

@blackbaud-sky-savage
Copy link
Collaborator

Tests passed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: f8e3574
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/285660701

(Please note that this is a fully automated comment.)

@blackbaud-sky-savage
Copy link
Collaborator

Tests passed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 7bc967c
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/285665404

(Please note that this is a fully automated comment.)

@blackbaud-sky-savage
Copy link
Collaborator

Tests passed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: 2cd94cf
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/285665709

(Please note that this is a fully automated comment.)

@blackbaud-sky-savage
Copy link
Collaborator

Tests passed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: b1b1214
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/286666608

(Please note that this is a fully automated comment.)

@blackbaud-sky-savage
Copy link
Collaborator

Tests passed. Automated cross-browser testing via BrowserStack and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED

Commit: de3d5d3
Build details: https://travis-ci.org/blackbaud-sky-savage/skyux2/builds/286695770

(Please note that this is a fully automated comment.)

@Blackbaud-PaulCrowder Blackbaud-PaulCrowder merged commit 3530e48 into blackbaud:master Oct 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants