Skip to content

Commit bb911fc

Browse files
committed
resolves #620
1 parent e6cef45 commit bb911fc

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

src/assets/js/customizer/controls.js

+5-16
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,13 @@
55
* @param $
66
*/
77
( function( $ ) {
8-
var refreshEvent = $.Event( 'boldgrid_customizer_refresh' ),
9-
$body = $( 'body' ),
10-
$themeControls = $( '#customize-theme-controls' );
11-
$window = $( window );
8+
var refreshEvent = $.Event( 'boldgrid_customizer_refresh' ),
9+
$body = $( 'body' ),
10+
$themeControls = $( '#customize-theme-controls' ),
11+
$window = $( window );
1212

1313
$window.on( 'message', function( e ) {
14-
var message,
15-
event = e.originalEvent;
16-
17-
// Ensure we have a string that's JSON.parse-able.
18-
if ( 'string' !== typeof event.data || '{' !== event.data[0] ) {
19-
return;
20-
}
21-
22-
message = JSON.parse( event.data );
23-
if ( 'synced' === message.id ) {
24-
$window.trigger( refreshEvent, message );
25-
}
14+
$window.trigger( refreshEvent, e.originalEvent.data );
2615
} );
2716

2817
// Prevent interaction with panels until Customizer fully loads.

src/assets/js/customizer/widget-preview.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ BOLDGRID.CUSTOMIZER = BOLDGRID.CUSTOMIZER || {};
1212
self.hover_bound = false;
1313
self.section_click_bound = false;
1414
$( function() {
15-
$window.on( 'boldgrid_customizer_refresh', onload );
15+
$( window ).on( 'boldgrid_customizer_refresh', onload );
1616
} );
1717

1818
onload = function() {

0 commit comments

Comments
 (0)