diff --git a/README.md b/README.md index 48f71f3..7d00e9e 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ The default configuration is var config = { decrementButton: "-", // button text incrementButton: "+", // .. - groupClass: "", // css class of the input-group (sizing with input-group-sm or input-group-lg) + groupClass: "", // css class of the resulting input-group buttonsClass: "btn-outline-secondary", buttonsWidth: "2.5rem", textAlign: "center", @@ -167,8 +167,12 @@ $(element).val(newValue) // write The attributes `min`, `max`, `step`, `stepMax`, `decimals`, `placeholder`, `required`, `disabled` and `class` +are handled dynamically. The `class` attribute value is dynamically copied to the input element. -are handled dynamically. The `class` attribute value is copied to the input-group and the resulting input element. +#### Sizing + +If the original elements class is set to `form-control-sm` of `form-control-lg` the class of the resulting input-group is +dynamically set to `input-group-sm` or `input-group-lg`. ### Events diff --git a/index.html b/index.html index a53a19f..7881ecb 100644 --- a/index.html +++ b/index.html @@ -243,17 +243,20 @@

Prefix and Suffix

Sizing

-

You can set the group css class via configuration.

+

Please note: The sizing changed with version 1.11 from setting the group class in the configuration to automatically use + the original elements class.

+

Sizing now works out of the box. If the original input has the class form-control-sm or form-control-lg, + the resulting group gets the class input-group-sm or input-group-lg.

Small - +

-
$("input.small").inputSpinner({groupClass: "input-group-sm"})
+
<input type="number" class="form-control-sm" value="0.0" data-decimals="4" min="-1" max="1" step="0.0001"/>

Large - +

-
$("input.large").inputSpinner({groupClass: "input-group-lg"})
+
<input type="number" class="form-control-lg" value="1000000" data-decimals="0" min="0" max="2000000" step="1"/>

Attribute data-step-max and looping the value

This Input starts from 0 when reaching 360.

@@ -284,8 +287,6 @@

Thats all for now