Merge pull request #13909 from woocommerce/fix/prevent-only-color-picker-to-flip
Prevent RTL flip only color picker inputs
This commit is contained in:
commit
168a4a3096
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -3156,6 +3156,7 @@ img.help_tip {
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
/* rtl:ignore */
|
/* rtl:ignore */
|
||||||
border-right: 0;
|
border-right: 0;
|
||||||
|
margin-left: -3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.colorpick {
|
.colorpick {
|
||||||
|
|
|
@ -291,41 +291,52 @@ class WC_Admin_Settings {
|
||||||
case 'text':
|
case 'text':
|
||||||
case 'email':
|
case 'email':
|
||||||
case 'number':
|
case 'number':
|
||||||
case 'color' :
|
|
||||||
case 'password' :
|
case 'password' :
|
||||||
|
|
||||||
$type = $value['type'];
|
|
||||||
$option_value = self::get_option( $value['id'], $value['default'] );
|
$option_value = self::get_option( $value['id'], $value['default'] );
|
||||||
|
|
||||||
if ( 'color' === $value['type'] ) {
|
|
||||||
$type = 'text';
|
|
||||||
$value['class'] .= 'colorpick';
|
|
||||||
$description .= '<div id="colorPickerDiv_' . esc_attr( $value['id'] ) . '" class="colorpickdiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;"></div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
?><tr valign="top">
|
?><tr valign="top">
|
||||||
<th scope="row" class="titledesc">
|
<th scope="row" class="titledesc">
|
||||||
<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
|
<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
|
||||||
<?php echo $tooltip_html; ?>
|
<?php echo $tooltip_html; ?>
|
||||||
</th>
|
</th>
|
||||||
<td class="forminp forminp-<?php echo sanitize_title( $value['type'] ) ?>">
|
<td class="forminp forminp-<?php echo sanitize_title( $value['type'] ) ?>">
|
||||||
‎
|
|
||||||
<?php
|
|
||||||
if ( 'color' == $value['type'] ) {
|
|
||||||
echo '<span class="colorpickpreview" style="background: ' . esc_attr( $option_value ) . ';"></span>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<input
|
<input
|
||||||
name="<?php echo esc_attr( $value['id'] ); ?>"
|
name="<?php echo esc_attr( $value['id'] ); ?>"
|
||||||
id="<?php echo esc_attr( $value['id'] ); ?>"
|
id="<?php echo esc_attr( $value['id'] ); ?>"
|
||||||
type="<?php echo esc_attr( $type ); ?>"
|
type="<?php echo esc_attr( $value['type'] ); ?>"
|
||||||
dir="ltr"
|
|
||||||
style="<?php echo esc_attr( $value['css'] ); ?>"
|
style="<?php echo esc_attr( $value['css'] ); ?>"
|
||||||
value="<?php echo esc_attr( $option_value ); ?>"
|
value="<?php echo esc_attr( $option_value ); ?>"
|
||||||
class="<?php echo esc_attr( $value['class'] ); ?>"
|
class="<?php echo esc_attr( $value['class'] ); ?>"
|
||||||
placeholder="<?php echo esc_attr( $value['placeholder'] ); ?>"
|
placeholder="<?php echo esc_attr( $value['placeholder'] ); ?>"
|
||||||
<?php echo implode( ' ', $custom_attributes ); ?>
|
<?php echo implode( ' ', $custom_attributes ); ?>
|
||||||
|
/> <?php echo $description; ?>
|
||||||
|
</td>
|
||||||
|
</tr><?php
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Color picker.
|
||||||
|
case 'color' :
|
||||||
|
$option_value = self::get_option( $value['id'], $value['default'] );
|
||||||
|
|
||||||
|
?><tr valign="top">
|
||||||
|
<th scope="row" class="titledesc">
|
||||||
|
<label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
|
||||||
|
<?php echo $tooltip_html; ?>
|
||||||
|
</th>
|
||||||
|
<td class="forminp forminp-<?php echo sanitize_title( $value['type'] ) ?>">‎
|
||||||
|
<span class="colorpickpreview" style="background: <?php echo esc_attr( $option_value ); ?>"></span>
|
||||||
|
<input
|
||||||
|
name="<?php echo esc_attr( $value['id'] ); ?>"
|
||||||
|
id="<?php echo esc_attr( $value['id'] ); ?>"
|
||||||
|
type="text"
|
||||||
|
dir="ltr"
|
||||||
|
style="<?php echo esc_attr( $value['css'] ); ?>"
|
||||||
|
value="<?php echo esc_attr( $option_value ); ?>"
|
||||||
|
class="<?php echo esc_attr( $value['class'] ); ?>colorpick"
|
||||||
|
placeholder="<?php echo esc_attr( $value['placeholder'] ); ?>"
|
||||||
|
<?php echo implode( ' ', $custom_attributes ); ?>
|
||||||
/>‎ <?php echo $description; ?>
|
/>‎ <?php echo $description; ?>
|
||||||
|
<div id="colorPickerDiv_<?php echo esc_attr( $value['id'] ); ?>" class="colorpickdiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;"></div>
|
||||||
</td>
|
</td>
|
||||||
</tr><?php
|
</tr><?php
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue