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

Iframe needs to resize to suit contents #9

Open
wnda opened this issue May 17, 2017 · 6 comments
Open

Iframe needs to resize to suit contents #9

wnda opened this issue May 17, 2017 · 6 comments
Assignees

Comments

@wnda
Copy link
Member

wnda commented May 17, 2017

Continued from #4 :

Styling is okay, but we need a means to adjust the sizing of the iframe when the search bar opens and when the results are displayed.

It's not difficult, we just need to decide on the proper event to trigger the resize. I'm thinking:

submit - resizes iframe to accommodate results display
click - resizes iframe to accommodate (or not) search bar.

@artmilt
Copy link

artmilt commented May 24, 2017

Are we putting the event listener within the iframe global context or in the top global context?

@artmilt
Copy link

artmilt commented May 24, 2017

Can't edit on phone.

I can do this one if you want.

@wnda
Copy link
Member Author

wnda commented May 24, 2017

Oh, you do exist! I was beginning to wonder if you were still up for it.

Please feel free, just follow my conventions if you don't mind. I suggest you have a read through the prior issues and review the source code to see where we're up to.

In jsearch.iframe.js you'll see that we're injecting the Javascript as a string using encodeURIComponent and then creating a Blob URL. It's not pretty, but this way it works self-contained i.e. no additional HTTP request is required.

The code that is currently being injected is technically a few commits behind where jsearch.js core is up to, but you can work with the jsearch.iframe.js script and just get it resizing appropriately.

Remember it needs to be responsive, full screen coverage on mobile and standard sort of widget sizing on desktop, I mean 25% width of screen sort of thing, maybe a max-width of 300px. We want it to look neat.

Lois and I have been blogging and covering some SEO/marketing basics to get started. I didn't mention any content writing to you because I wasn't sure how you would feel about it — I anticipated that you would have no interest in that side of things. You're of course welcome to contribute if you want.

If you have any questions or if you need anything, don't raise an issue, just go to Gitter. I'll invite you to the dev channel. I'm trying to keep our internal chatter there.

@loisatwood
Copy link
Member

loisatwood commented May 24, 2017

welcome aboard arthur.

@wnda you didn't answer arthur's question; @artmilt i guess that's something we need to do from inside the iframe using window.postMessage

@wnda
Copy link
Member Author

wnda commented May 24, 2017

@loisatwood @artmilt Sorry about that, I didn't notice the first message!

Lois is right, we could use postMessage to send a signal to resize the iframe from the top level context, that would probably be the best and easiest way.

@wnda wnda assigned artmilt and unassigned wnda May 24, 2017
@wnda
Copy link
Member Author

wnda commented May 24, 2017

I'll let you two come up with a way to do this nice and smoothly while I work on the finer points of how I think the widget should look.

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

No branches or pull requests

3 participants