angular / preboot

Coordinate transfer of state from server to client view for isomorphic/universal JavaScript web applications
MIT License
382 stars 51 forks source link

feat: add disable overlay functionality; default to false #101

Closed ankitu closed 5 years ago

ankitu commented 5 years ago

This commit adds disable freeze overlay functionality, usage disableOverlay option can be passed to the preboot initial config as follows:

PrebootModule.withConfig({ appRoot: 'app-root', disableOverlay: true })
googlebot commented 5 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers
ankitu commented 5 years ago

I signed it!

On Fri, Jan 18, 2019 at 12:32 PM googlebot notifications@github.com wrote:

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.

What to do if you already signed the CLA Individual signers

Corporate signers

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/angular/preboot/pull/101#issuecomment-455447358, or mute the thread https://github.com/notifications/unsubscribe-auth/AgSqOtpKFCCnGdeyG2-n_gzI86O0G9jaks5vEXGIgaJpZM4aHVtB .

googlebot commented 5 years ago

CLAs look good, thanks!

ankitu commented 5 years ago

@mgol Feedback addressed, and thanks for the prompt reply

ankitu commented 5 years ago

@mgol We are already skipping the overlay creation in getAppRoot

// create an overlay if not disabled ,that can be used later if a freeze event occurs
  if (!opts.disableOverlay) {
    root.overlay = createOverlay(_document);
  }

And in cleanup, I guess condition is not required as we are are already checking for prebootOverlay id.

const prebootOverlay = doc.getElementById('prebootOverlay');
    if (prebootOverlay) {
      prebootOverlay.remove ?
        prebootOverlay.remove() : prebootOverlay.parentNode !== null ?
        prebootOverlay.parentNode.removeChild(prebootOverlay) :
        prebootOverlay.style.display = 'none';
    }