Opened 10 years ago
Closed 10 years ago
#35616 closed enhancement (fixed)
Align settings in Customizer preview with settings in Customizer pane
| Reported by: | | Owned by: | |
|---|---|---|---|
| Milestone: | 4.5 | Priority: | normal |
| Severity: | normal | Version: | 3.4 |
| Component: | Customize | Keywords: | has-patch |
| Focuses: | javascript | Cc: |
Description
The JS models for Customizer settings in the Customizer preview are somewhat shallow representations of the settings in the Customizer pane. Indeed, the objects in the preview are mere wp.customize.Value objects as opposed to wp.customize.Setting objects. A few issues:
- The setting objects in the preview lack an
idproperty. - When new settings get instantiated in the pane and get synced into the preview, the settings are just silently ignored as opposed to being created on demand as is when the
settingsmessage is received by the preview. - The
_dirtyflags for settings in the preview don't always correspond to the corresponding settings in the pane, e.g. they get reset after a refresh and they fail to reset aftersaved.
These improvements are key for performing more logic inline to the preview, such as selective refresh (#27355).
Attachments (2)
Change History (5)
Note: See TracTickets for help on using tickets.
In 35616.0.diff:
Valueobjects in preview get initial_dirtyflag set if values among POST data.savedevent, sendsavedmessage to preview with theresponseto triggersavedevent there._dirtyflag for all settingValueobjects in preview uponsaved.idproperty is set for settingValueobjects in preview.