Skip to content

Commit

Permalink
fixed customizer live preview and notices
Browse files Browse the repository at this point in the history
  • Loading branch information
felixarntz committed Aug 16, 2015
1 parent 69884b8 commit c0997bf
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/classes/class-customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public function register( $wp_customize ) {
public function register_instance( $wp_customize, $i ) {
//** Add Section if it has not been added yet. */
$sections = $this->get( 'sections' );
if( !$wp_customize->get_section( $section ) ) {
if( !$wp_customize->get_section( $i[ 'section' ] ) ) {
$section = wp_parse_args( $sections[ $i[ 'section' ] ], array(
'title' => __( 'No Name' ),
'priority' => 100,
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lib-wp-theme",
"version": "0.3.4",
"version": "0.3.6",
"private": true,
"repository": {
"type": "git",
Expand All @@ -10,16 +10,17 @@
"node": ">= 0.10.0"
},
"devDependencies": {
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-less": "~0.8.3",
"grunt-contrib-symlink": "~0.2.0",
"grunt-contrib-uglify": "~0.2.4",
"grunt-contrib-watch": "~0.5.3",
"grunt-markdown": "~0.4.0",
"grunt-mocha-cli": "~1.5.0",
"grunt-mocha-cov": "~0.1.1",
"grunt-requirejs": "~0.4.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-clean": "~0.5.0",
"grunt-shell": "~0.6.0",
"grunt-contrib-less": "~0.8.3",
"grunt-mocha-cli": "~1.5.0",
"grunt-mocha-cov": "~0.1.1"
"load-grunt-tasks": "^3.2.0"
}
}
21 changes: 15 additions & 6 deletions scripts/src/udx.wp.customizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@
*/
function updateStyles( c, style ) {
// Oue dynamically generated style element
var v = '';
if( style && style.length > 0 ) {
var v = c.selector + '{ ' + c.style + ':' + c.prefix + style + c.postfix + ' !important; }';
if ( c && c.length > 0 ) {
var v = '';
var mod_name = c[0].mod_name;
if( style && style.length > 0 ) {
for ( var i in c ) {
v += c[ i ].selector + ' { ' + c[ i ].style + ':' + c[ i ].prefix + style + c[ i ].postfix + ' !important; } ';
}
}
$( 'head #lib_wp_theme_customizer_' + mod_name ).text( v );
}
$( 'head #lib_wp_theme_customizer_' + c.mod_name ).text( v );

}

Expand All @@ -43,8 +48,12 @@
*/
function updateImage( c, src ) {
// Oue dynamically generated style element
if( src && src.length > 0 && $( c.selector ).length > 0 ) {
$( c.selector ).attr( 'src', src );
if( src && src.length > 0 ) {
for ( var i in c ) {
if ( c[ i ].selector.length > 0 ) {
$( c[ i ].selector ).attr( 'src', src );
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/udx.wp.customizer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/udx.wp.editor.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/udx.wp.spa.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/udx.wp.theme.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c0997bf

Please sign in to comment.