Skip to content

Commit

Permalink
fixes #960
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed May 3, 2016
1 parent 80b034f commit b6136ba
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion includes/class-kirki-enqueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function customize_controls_enqueue_scripts() {
'radio-buttonset' => array( 'jquery', 'customize-base' ),
'radio-image' => array( 'jquery', 'customize-base' ),
'radio' => array( 'jquery', 'customize-base' ),
'repeater' => array( 'jquery', 'customize-base', 'jquery-ui-core', 'jquery-ui-sortable' ),
'repeater' => array( 'jquery', 'customize-base', 'jquery-ui-core', 'jquery-ui-sortable', 'kirki-l10n' ),
'select' => array( 'jquery', 'customize-base', 'selectize' ),
'slider' => array( 'jquery', 'customize-base' ),
'sortable' => array( 'jquery', 'customize-base', 'jquery-ui-core', 'jquery-ui-sortable', 'serialize-js' ),
Expand Down
27 changes: 13 additions & 14 deletions includes/controls/class-kirki-controls-repeater-control.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ protected function render_content() {
* @access public
*/
public function repeater_js_template() {
$l10n = Kirki_l10n::get_strings();
?>
<script type="text/html" class="customize-control-repeater-content">
<# var field; var index = data.index; #>
Expand Down Expand Up @@ -434,22 +433,22 @@ public function repeater_js_template() {
<# } #>
</label>

<figure class="kirki-image-attachment" data-placeholder="<?php esc_attr_e( $l10n['no-image-selected'] ); ?>" >
<figure class="kirki-image-attachment" data-placeholder="{{ window.kirki.l10n['no-image-selected'] }}" >
<# if ( field.default ) { #>
<# var defaultImageURL = ( field.default.url ) ? field.default.url : field.default; #>
<img src="{{{ defaultImageURL }}}">
<# } else { #>
<?php esc_attr_e( $l10n['no-image-selected'] ); ?>
{{ window.kirki.l10n['no-image-selected'] }}
<# } #>
</figure>

<div class="actions">
<button type="button" class="button remove-button<# if ( ! field.default ) { #> hidden<# } #>"><?php esc_attr_e( $l10n['remove'] ); ?></button>
<button type="button" class="button upload-button" data-label="<?php esc_attr_e( $l10n['add-image'] ); ?>" data-alt-label="<?php esc_attr_e( $l10n['change-image'] ); ?>" >
<button type="button" class="button remove-button<# if ( ! field.default ) { #> hidden<# } #>">{{ window.kirki.l10n['remove'] }}</button>
<button type="button" class="button upload-button" data-label=" {{ window.kirki.l10n['add-image'] }}" data-alt-label="{{ window.kirki.l10n['change-image'] }}" >
<# if ( field.default ) { #>
<?php esc_attr_e( $l10n['change-image'] ); ?>
{{ window.kirki.l10n['change-image'] }}
<# } else { #>
<?php esc_attr_e( $l10n['add-image'] ); ?>
{{ window.kirki.l10n['add-image'] }}
<# } #>
</button>
<# if ( field.default.id ) { #>
Expand All @@ -470,22 +469,22 @@ public function repeater_js_template() {
<# } #>
</label>

<figure class="kirki-file-attachment" data-placeholder="<?php esc_attr_e( $l10n['no-file-selected'] ); ?>" >
<figure class="kirki-file-attachment" data-placeholder="{{ window.kirki.l10n['no-file-selected'] }}" >
<# if ( field.default ) { #>
<# var defaultFilename = ( field.default.filename ) ? field.default.filename : field.default; #>
<span class="file"><span class="dashicons dashicons-media-default"></span> {{ defaultFilename }}</span>
<# } else { #>
<?php esc_attr_e( $l10n['no-file-selected'] ); ?>
{{ window.kirki.l10n['no-file-selected'] }}
<# } #>
</figure>

<div class="actions">
<button type="button" class="button remove-button<# if ( ! field.default ) { #> hidden<# } #>"><?php esc_attr_e( $l10n['remove'] ); ?></button>
<button type="button" class="button upload-button" data-label="<?php esc_attr_e( $l10n['add-file'] ); ?>" data-alt-label="<?php esc_attr_e( $l10n['change-file'] ); ?>" >
<button type="button" class="button remove-button<# if ( ! field.default ) { #> hidden<# } #>">{{ window.kirki.l10n.remove }}</button>
<button type="button" class="button upload-button" data-label="{{ window.kirki.l10n['add-file'] }}" data-alt-label="{{ window.kirki.l10n['change-file'] }}" >
<# if ( field.default ) { #>
<?php esc_attr_e( $l10n['change-file'] ); ?>
{{ window.kirki.l10n['change-file'] }}
<# } else { #>
<?php esc_attr_e( $l10n['add-file'] ); ?>
{{ window.kirki.l10n['add-file'] }}
<# } #>
</button>
<# if ( field.default.id ) { #>
Expand All @@ -499,7 +498,7 @@ public function repeater_js_template() {

</div>
<# }); #>
<button type="button" class="button-link repeater-row-remove"><?php esc_attr_e( $l10n['remove'] ); ?></button>
<button type="button" class="button-link repeater-row-remove">{{ window.kirki.l10n.remove }}</button>
</div>
</li>
</script>
Expand Down

0 comments on commit b6136ba

Please sign in to comment.