Skip to content

Instantly share code, notes, and snippets.

@shaun-stripe
Created April 12, 2016 18:35
Show Gist options
  • Select an option

  • Save shaun-stripe/9a356f68a12563548d2e5383061ff1a5 to your computer and use it in GitHub Desktop.

Select an option

Save shaun-stripe/9a356f68a12563548d2e5383061ff1a5 to your computer and use it in GitHub Desktop.
AuthenticationService.prototype.applyStyles = function (iframe) {
  iframe.style.position = 'fixed';
  iframe.style.top = '0';
  iframe.style.left = '0';
  iframe.style.height = '100%';
  iframe.style.width = '100%';
  iframe.setAttribute('frameborder', '0');
  iframe.setAttribute('allowTransparency', 'true');
  iframe.style.border = '0';
  iframe.style.zIndex = '99999';
};

Some extra mobile-specific things hiding scrollbars of the body:

AuthenticationService.prototype.lockMerchantWindowSize = function () {
  htmlNode.style.overflow = 'hidden';
  bodyNode.style.overflow = 'hidden';
  bodyNode.style.height = '100%';
};
AuthenticationService.prototype.unlockMerchantWindowSize = function () {
  var defaultStyles = this.merchantPageDefaultStyles;
  bodyNode.style.height = defaultStyles.body.height;
  bodyNode.style.overflow = defaultStyles.body.overflow;
  htmlNode.style.overflow = defaultStyles.html.overflow;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment