Opened 9 years ago
Closed 9 years ago
#35616 closed enhancement (fixed)
Align settings in Customizer preview with settings in Customizer pane
Reported by: | westonruter | Owned by: | westonruter |
---|---|---|---|
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
id
property. - 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
settings
message is received by the preview. - The
_dirty
flags 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:
Value
objects in preview get initial_dirty
flag set if values among POST data.saved
event, sendsaved
message to preview with theresponse
to triggersaved
event there._dirty
flag for all settingValue
objects in preview uponsaved
.id
property is set for settingValue
objects in preview.