-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #236 from MachoThemes/master
Update 1.2.1
- Loading branch information
Showing
26 changed files
with
502 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
(function( $ ) {// jscs:ignore validateLineBreaks | ||
|
||
'use strict'; | ||
|
||
var api = wp.customize; | ||
|
||
api.bind( 'ready', function() { | ||
var currentURL = api.settings.url.preview, | ||
urlBase, | ||
urlParts, | ||
pageSidebarID, | ||
pageSidebarSection; | ||
if ( currentURL !== ShapelyBuilder.siteURL ) { | ||
urlParts = currentURL.split( '/' ); | ||
urlParts.pop(); | ||
urlBase = urlParts[ urlParts.length - 1 ]; | ||
if ( undefined !== ShapelyBuilder.pages[ urlBase ] ) { | ||
pageSidebarID = 'sidebar-widgets-shapely-' + urlBase; | ||
/* | ||
* Defer focus until: | ||
* 1. The section exist. | ||
* 2. The instance is embedded in the document (and so is focusable). | ||
* 3. The preview has finished loading so that the active states have been set. | ||
*/ | ||
pageSidebarSection = api.section( pageSidebarID, function( instance ) { | ||
instance.deferred.embedded.done( function() { | ||
api.previewer.deferred.active.done( function() { | ||
instance.focus(); | ||
} ); | ||
} ); | ||
} ); | ||
} | ||
} | ||
} ); | ||
|
||
})( jQuery ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
(function( $ ) {// jscs:ignore validateLineBreaks | ||
|
||
if ( 'undefined' !== typeof( wp ) ) { | ||
if ( 'undefined' !== typeof( wp.customize ) ) { | ||
wp.customize.bind( 'preview-ready', function() { | ||
wp.customize.preview.bind( 'update-inline-css', function( object ) { | ||
var data = { | ||
'action': object.action, | ||
'args': object.data, | ||
'id': object.id | ||
}; | ||
if ( 'undefined' !== typeof( wp ) ) { | ||
if ( 'undefined' !== typeof( wp.customize ) ) { | ||
wp.customize.bind( 'preview-ready', function() { | ||
wp.customize.preview.bind( 'update-inline-css', function( object ) { | ||
var data = { | ||
'action': object.action, | ||
'args': object.data, | ||
'id': object.id | ||
}; | ||
|
||
jQuery.ajax({ | ||
dataType: 'json', | ||
type: 'POST', | ||
url: WPUrls.ajaxurl, | ||
data: data, | ||
complete: function( json ) { | ||
var sufix = object.action + object.id; | ||
var style = $( '#shapely-style-' + sufix ); | ||
jQuery.ajax( { | ||
dataType: 'json', | ||
type: 'POST', | ||
url: WPUrls.ajaxurl, | ||
data: data, | ||
complete: function( json ) { | ||
var sufix = object.action + object.id; | ||
var style = $( '#shapely-style-' + sufix ); | ||
|
||
if ( ! style.length ) { | ||
style = $( 'head' ).append( '<style type="text/css" id="shapely-style-' + sufix + '" />' ).find( '#shapely-style-' + sufix ); | ||
} | ||
if ( ! style.length ) { | ||
style = $( 'head' ).append( '<style type="text/css" id="shapely-style-' + sufix + '" />' ).find( '#shapely-style-' + sufix ); | ||
} | ||
|
||
style.html( json.responseText ); | ||
} | ||
}); | ||
}); | ||
}); | ||
} | ||
} | ||
style.html( json.responseText ); | ||
} | ||
} ); | ||
} ); | ||
} ); | ||
} | ||
} | ||
|
||
})( jQuery ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.