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

Automating postMessage for composite fields #694

Closed
allysonsouza opened this issue Feb 28, 2016 · 6 comments
Closed

Automating postMessage for composite fields #694

allysonsouza opened this issue Feb 28, 2016 · 6 comments
Assignees
Labels
Milestone

Comments

@allysonsouza
Copy link

It's possible to use automatic postMessage for composite fields like Typography field? If yes, how could I do this?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@aristath
Copy link
Contributor

We're working on adding postMessage support to other composite fields, however the typography field has special requirements.
The problem with the typography field is that it it doesn't only change the font-weight, height, size etc of your typography, but also the font-family.
Font-families from google-fonts require us to change the actual markup of the page, not just the CSS. We have to re-load the fonts and change the request we make to the Google API. This can't work without refreshing the page, which is why in typography fields we're forcing a refresh.

I'm currently rebuilding the typography control in the develop branch and perhaps I'll be able to add partial support for postMessage (perhaps I can make it work for fields like the font-size, color etc) but I can't make any promises at this point.

@allysonsouza
Copy link
Author

Thanks for the reply @aristath, I understand the complexity of this using Google Fonts. Anyway, postMessage to fields such as font-size and color at least, will be very nice! 👍

@aristath aristath modified the milestone: 2.2 Mar 3, 2016
aristath added a commit that referenced this issue Mar 3, 2016
@aristath aristath self-assigned this Mar 3, 2016
@aristath
Copy link
Contributor

aristath commented Mar 4, 2016

@allysonsouza I started implementing this but unfortunately another issue made my attempts futile.
No matter what I did, the first couple of changes were applied via postMessage normally, and then this issue would kick in and mess things up: #717

So until someone helps us resolve that one, this will have to wait

I've been trying to address that issue for days without success so at this point I just set up a community-backed bounty and hope someone more skillful than myself with JS can find a solution, or that enough people pitch in a bounty to make resolving this issue more appealing to devs.

That being said, I figured out how to do the auto-postMessage for typography controls and they're pretty awesome - when they work.

@aristath aristath modified the milestones: 2.2, 2.3 Mar 23, 2016
@aristath aristath modified the milestones: 2.3, 3.0 Apr 10, 2016
@manuelmoreale
Copy link
Contributor

Maybe my last comment on the #717 can help @aristath find where the problem is and allow him to implement postMessages in the typography field. I'm coding a new theme were I have quite a few of those and would be awesome to have live preview for color, font size, line height and text align.

@manuelmoreale
Copy link
Contributor

manuelmoreale commented Apr 18, 2016

@aristath now that #717 has been fixed any idea when you'll be able to implement/solve this one? Asking because I'm putting the last touch on a new theme and if you're going to release a new version soon I'll wait and change the structure of my fields since I now have a bunch of fields separated from the main typography field only to give users live preview :)

@aristath
Copy link
Contributor

This has been fixed.
Using 'transport' => 'auto' in typography controls has the desired result now.

@aristath aristath modified the milestones: 3.0, 2.4.0 Dec 10, 2016
@aristath aristath modified the milestones: 2.4.0, 3.0 Mar 28, 2017
@aristath aristath modified the milestones: 3.0, 2.4.0 Mar 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants