diff --git a/classes/views/styles/_buttons.php b/classes/views/styles/_buttons.php index 36ad9cc90f..acf16e6bea 100644 --- a/classes/views/styles/_buttons.php +++ b/classes/views/styles/_buttons.php @@ -52,8 +52,7 @@ class="frm-style-item-heading">
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
?>
-
+
?>
-
+
?>
-
+
- +
- +
- +
- +
- +
- +
- +
- +
- +

- +
- +
data['unit_measurement'] = $this->detect_unit_measurement(); + $this->data['unit_measurement'] = self::detect_unit_measurement( $this->field_value ); $this->data['has-multiple-values'] = count( $this->get_values() ) > 1; $this->data['units'] = $this->get_units_list( $data ); $this->data['value_label'] = self::measured_value( $field_value, $this->data['unit_measurement'] ); @@ -231,33 +231,33 @@ private function init_multiple_values() { $right = $values[1]; $this->data['vertical'] = array( - 'unit' => $this->detect_unit_measurement( $top ), - 'value' => self::measured_value( $top, $this->detect_unit_measurement( $top ) ), + 'unit' => self::detect_unit_measurement( $top ), + 'value' => self::measured_value( $top, self::detect_unit_measurement( $top ) ), ); $this->data['horizontal'] = array( - 'unit' => $this->detect_unit_measurement( $right ), - 'value' => self::measured_value( $right, $this->detect_unit_measurement( $right ) ), + 'unit' => self::detect_unit_measurement( $right ), + 'value' => self::measured_value( $right, self::detect_unit_measurement( $right ) ), ); $this->data['top'] = array( - 'unit' => $this->detect_unit_measurement( $top ), - 'value' => self::measured_value( $top, $this->detect_unit_measurement( $top ) ), + 'unit' => self::detect_unit_measurement( $top ), + 'value' => self::measured_value( $top, self::detect_unit_measurement( $top ) ), ); $this->data['bottom'] = array( - 'unit' => $this->detect_unit_measurement( $bottom ), - 'value' => self::measured_value( $bottom, $this->detect_unit_measurement( $bottom ) ), + 'unit' => self::detect_unit_measurement( $bottom ), + 'value' => self::measured_value( $bottom, self::detect_unit_measurement( $bottom ) ), ); $this->data['left'] = array( - 'unit' => $this->detect_unit_measurement( $left ), - 'value' => self::measured_value( $left, $this->detect_unit_measurement( $left ) ), + 'unit' => self::detect_unit_measurement( $left ), + 'value' => self::measured_value( $left, self::detect_unit_measurement( $left ) ), ); $this->data['right'] = array( - 'unit' => $this->detect_unit_measurement( $right ), - 'value' => self::measured_value( $right, $this->detect_unit_measurement( $right ) ), + 'unit' => self::detect_unit_measurement( $right ), + 'value' => self::measured_value( $right, self::detect_unit_measurement( $right ) ), ); } @@ -347,15 +347,11 @@ private function get_values() { * * @since 6.14 * - * @param string|null $value + * @param string $value * * @return string */ - private function detect_unit_measurement( $value = null ) { - if ( null === $value ) { - $value = $this->field_value; - } - + private static function detect_unit_measurement( $value ) { // 'auto' has its own option in the unit dropdown where that keyword is offered, so it can // be selected (and announced) on load instead of always falling through to the blank option. if ( 'auto' === $value ) { @@ -373,6 +369,61 @@ private function detect_unit_measurement( $value = null ) { return preg_match( '/px$/', $value ) ? 'px' : ''; } + /** + * Whether a slider's raw saved value renders its value input enabled - a disabled input can + * never receive focus, so a template deciding whether a
- is_measured_unit( $component['vertical']['unit'] ) ); ?> /> + is_measured_unit( $component['vertical']['unit'] ) ); ?> /> is_measured_unit( $component['unit_measurement'] ) ); ?> /> + is_measured_unit( $component['unit_measurement'] ) ); ?> /> value="" id="" /> is_measured_unit( $component['unit_measurement'] ) ); ?> /> + is_measured_unit( $component['unit_measurement'] ) ); ?> />