Tobias Jeger pushed to branch feature/cmng-psp1 at cms-community / 
hippo-addon-channel-manager


Commits:
175f3374 by Tobias Jeger at 2016-03-09T15:19:40+01:00
CHANNELMGR-488: improve iframe height determination.

- - - - -


1 changed file:

- frontend-ng/src/angularjs/channel/hippoIframe/overlay/overlaySync.service.js


Changes:

=====================================
frontend-ng/src/angularjs/channel/hippoIframe/overlay/overlaySync.service.js
=====================================
--- 
a/frontend-ng/src/angularjs/channel/hippoIframe/overlay/overlaySync.service.js
+++ 
b/frontend-ng/src/angularjs/channel/hippoIframe/overlay/overlaySync.service.js
@@ -74,10 +74,15 @@ export class OverlaySyncService {
 
   _syncHeight() {
     if (this.iframeJQueryElement && this.overlayJQueryElement) {
-      const html = this._getIframeWindow().document.documentElement;
+      const doc = this._getIframeWindow().document;
 
-      if (html !== null) {
-        const height = html.offsetHeight;
+      if (doc) {
+        const html = doc.documentElement;
+        const body = doc.body;
+
+        // cross-browser document height checking
+        const height = Math.max(body.scrollHeight, body.offsetHeight,
+                                html.clientHeight, html.scrollHeight, 
html.offsetHeight);
 
         // Prevent weird twitching at certain widths
         html.style.overflow = 'hidden';



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/175f33746e0a9ea950d55c12277cbb9e59964b92
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to