This commit is contained in:
Alexander Agnarson 2020-02-25 18:04:54 +01:00
parent 62def2a89b
commit 7ad333b360
167 changed files with 2955 additions and 2493 deletions

View file

@ -62,7 +62,6 @@ if ( _.isUndefined( window.kirkiSetSettingValue ) ) {
break;
case 'kirki-select':
case 'kirki-fontawesome':
$this.setSelectWoo( $this.findElement( setting, 'select' ), value );
break;
@ -1970,13 +1969,15 @@ wp.customize.controlConstructor['kirki-editor'] = wp.customize.kirkiDynamicContr
id = 'kirki-editor-' + control.id.replace( '[', '' ).replace( ']', '' ),
editor;
wp.editor.initialize( id, {
tinymce: {
wpautop: true
},
quicktags: true,
mediaButtons: true
} );
if ( wp.editor && wp.editor.initialize ) {
wp.editor.initialize( id, {
tinymce: {
wpautop: true
},
quicktags: true,
mediaButtons: true
} );
}
editor = tinyMCE.get( id );
@ -1992,45 +1993,6 @@ wp.customize.controlConstructor['kirki-editor'] = wp.customize.kirkiDynamicContr
}
}
} );
/* global fontAwesomeJSON */
wp.customize.controlConstructor['kirki-fontawesome'] = wp.customize.kirkiDynamicControl.extend( {
initKirkiControl: function() {
var control = this,
element = this.container.find( 'select' ),
icons = jQuery.parseJSON( fontAwesomeJSON ),
selectValue,
selectWooOptions = {
data: [],
escapeMarkup: function( markup ) {
return markup;
},
templateResult: function( val ) {
return '<i class="fa fa-lg fa-' + val.id + '" aria-hidden="true"></i>' + ' ' + val.text;
},
templateSelection: function( val ) {
return '<i class="fa fa-lg fa-' + val.id + '" aria-hidden="true"></i>' + ' ' + val.text;
}
},
select;
_.each( icons.icons, function( icon ) {
selectWooOptions.data.push( {
id: icon.id,
text: icon.name
} );
} );
select = jQuery( element ).selectWoo( selectWooOptions );
select.on( 'change', function() {
selectValue = jQuery( this ).val();
control.setting.set( selectValue );
} );
select.val( control.setting._value ).trigger( 'change' );
}
} );
wp.customize.controlConstructor['kirki-multicheck'] = wp.customize.kirkiDynamicControl.extend( {
initKirkiControl: function() {