Arthur Bogaart pushed to branch bugfix/CHANNELMGR-1160 at cms-community / hippo-addon-channel-manager
Commits: 64b45b40 by Arthur Bogaart at 2017-02-16T16:02:28+01:00 CHANNELMGR-1160 Don't depend on load event order for initIframeElements - - - - - 510e5e45 by Arthur Bogaart at 2017-02-16T16:02:56+01:00 CHANNELMGR-1160 Rename variable iframeBody to iframeHtmlBody - - - - - 2 changed files: - frontend-ng/src/angularjs/channel/hippoIframe/scrolling/scroll.service.js - frontend-ng/src/angularjs/channel/hippoIframe/scrolling/scroll.service.spec.js Changes: ===================================== frontend-ng/src/angularjs/channel/hippoIframe/scrolling/scroll.service.js ===================================== --- a/frontend-ng/src/angularjs/channel/hippoIframe/scrolling/scroll.service.js +++ b/frontend-ng/src/angularjs/channel/hippoIframe/scrolling/scroll.service.js @@ -34,14 +34,11 @@ class ScrollService { top: 0, left: 0, }; - - this.iframe.on('load', () => { - this._initIframeElements(); - }); } enable(scrollAllowed) { if (!this.enabled && this.iframe) { + this._initIframeElements(); if (this.BrowserService.isFF()) { this._bindMouseMove(scrollAllowed); } else { ===================================== frontend-ng/src/angularjs/channel/hippoIframe/scrolling/scroll.service.spec.js ===================================== --- a/frontend-ng/src/angularjs/channel/hippoIframe/scrolling/scroll.service.spec.js +++ b/frontend-ng/src/angularjs/channel/hippoIframe/scrolling/scroll.service.spec.js @@ -242,10 +242,10 @@ describe('ScrollService', () => { it('should save scroll position', (done) => { loadIframeFixture(() => { const iframeDocument = $iframe.contents(); - const iframeBody = iframeDocument.find('html,body'); + const iframeHtmlBody = iframeDocument.find('html,body'); - iframeBody.scrollTop(50); - iframeBody.scrollLeft(60); + iframeHtmlBody.scrollTop(50); + iframeHtmlBody.scrollLeft(60); ScrollService.saveScrollPosition(); View it on GitLab: https://code.onehippo.org/cms-community/hippo-addon-channel-manager/compare/848bf4f3ed6b8bb4c722d62174620f06e4a84e5c...510e5e45e45cd24e1d4dfc6d26f2d69789fc1923
_______________________________________________ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn