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

Allow updating of widget preview before hitting Update #45

Closed
bobbravo2 opened this issue Oct 26, 2013 · 7 comments

Comments

@bobbravo2
Copy link
Contributor

commented Oct 26, 2013

Allow updating of a widget without having to press Update. Will require opt-in by the widget, as only the widget itself knows when it is able to be sufficiently previewed (e.g. the RSS widget will error if the fields aren't all supplied). Maybe some JS to detect when the widget control form is populated enough to be submitted. Filter for opting-in to postMessage should be segmented into opt-in for live editing of all fields, not just when hitting Update.

Depends on #37

@westonruter

This comment has been minimized.

Copy link
Contributor

commented Oct 26, 2013

This also will be addressed by #37, and it is the same problem as #44.

@westonruter

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2013

Original issue submitted:

Add keyup event for titles

Editing the widget title doesn't take effect until you press save/update.

Perhaps adding a keyup event with setTimeout? Check the interval between keyups - so that we don't flood the server with requests after every letter. We clearTimeout on keyups within that interval, so the last timeout to expire finally triggers a refresh.

@westonruter

This comment has been minimized.

@westonruter

This comment has been minimized.

@westonruter

This comment has been minimized.

Copy link
Contributor

commented Feb 4, 2014

We're going to try to make widget update with each keypress/change/input, and so eliminate the Update/Apply button altogether. However, I think it should only be done for widgets that explicitly indicate live-preview support. We'll also have to take care when processing updates because they include new forms with validated inputs, and just replacing the form with every input would cause focus problems and it would keep causing the user to lose their place.

@westonruter westonruter self-assigned this Feb 4, 2014
@westonruter

This comment has been minimized.

Copy link
Contributor

commented Feb 4, 2014

From Nacin:

seems to me like: a widget can say "hey, I'm live-previewable" and a theme can say "hey, I can accept live widget previews". if both are true for a particular theme/widget combo, then postMessage. otherwise, transparent refresh, no buttom. This is exactly how other customizer controls work.
I think following whatever we do currently for, say, Site Title, is a good model. Especially for widget titles. In general, throttling them a bit more might not be a bad idea, of course (say, big text widget). Listening for the change event is also going to be good for checkboxes/selects of course.

@westonruter westonruter added this to the 3.9 Merge Ready milestone Feb 9, 2014
@westonruter

This comment has been minimized.

Copy link
Contributor

commented Feb 10, 2014

I'm making good progress on this. Hope to have a PR for review by tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.