Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to support pages in the iFrame with no page name #22

Open
DSaunders opened this issue Dec 10, 2013 · 0 comments
Open

Unable to support pages in the iFrame with no page name #22

DSaunders opened this issue Dec 10, 2013 · 0 comments

Comments

@DSaunders
Copy link

Pages in web frameworks can be identified by a route rather than an explicit filename (for example http://mysite.com/somesite/).

If you do not set the exceptPages setting (as you do not want any pages to be excluded), and the page in the iFrame does not have a name, this causes the plugin not to resize the iFrame on these lines:

if((_pageHeight <= base.options.minimumHeight && base.options.exceptPages.indexOf(_pageName) == -1)) {
tryFixIframe();
} else if (_pageHeight > base.options.minimumHeight && base.options.exceptPages.indexOf(_pageName) == -1) {
base.setIframeHeight(_pageHeight + base.options.heightOffset);
}

I added a default value when _pageName is empty by doing the following:

if (!_pageName) {
_pageName = 'unnamed-pages';
}

This allows the plugin to work on unnamed pages, and also allows the caller to ignore all of these by setting the exceptPages to 'unnamed-pages' in configuration.

I was going to push my branch to your repository and raise a pull request but I was unable to (I do not have access to push branches), hence raising an issue instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant