• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

autoNumeric / autoNumeric / 171
85%
master: 85%

Build:
Build:
LAST BUILD BRANCH: v4.5.6
DEFAULT BRANCH: master
Ran 19 Apr 2017 08:10AM UTC
Jobs 1
Files 4
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
171

push

travis-ci

AlexandreBonneau
Add two new options `selectOnFocus` and `caretPositionOnFocus`

Add a new option `selectOnFocus` that allow the user to choose if the value should be selected when the element is focused.
Add a new option `caretPositionOnFocus` that allow the user to choose where should be positioned the caret when the element is focused.
Modify how the caret is treated on focus ; if the `selectOnFocus` option is `true` then the value is selected, otherwise the caret is set at the position defined by the `caretPositionOnFocus` option.
`caretPositionOnFocus` can be `'start'`, `'end'`, `'decimalLeft'` and `'decimalRight'`, and will change where the caret will be positioned when the element get the focus. It can also be `null` which means the caret position is not forced.
The caret position is calculated by the new `_initialCaretPosition()` function.
Modify `validate()` so that an empty object can be used for the options, since the default settings would then be merged and used.
Modify the `validate()` function signature so that it accepts a third argument, the raw options passed by the user, without them having been merged with the default settings. This is useful for checking conflicting options that could be overwritten by the defaults.
Rewrite the call to `validate()` from `areSettingsValid()` to make it more explicit.
Rewrite one test condition in `_onFocusInAndMouseEnter()` so that it's not reserved only for elements that have their `emptyInputBehavior` option set to `focus` anymore.
Add a `focusin` event handler via `_onFocusIn()`, which take care of managing the element content selection on focus.
Add the `_correctCaretPositionOnFocusAndSelectOnFocusOptions()` function that manage the `caretPositionOnFocus` and `selectOnFocus` options in order to prevent any conflict.
Strengthen `setElementSelection()` so that `element.firstChild` is checked for `null` value.

Signed-off-by: Alexandre Bonneau <alexandre.bonneau@linuxfr.eu>

1746 of 2882 relevant lines covered (60.58%)

418.97 hits per line

Jobs
ID Job ID Ran Files Coverage
1 171.1 19 Apr 2017 08:10AM UTC 0
60.58
Travis Job 171.1
Source Files on build 171
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #171
  • b962b146 on github
  • Prev Build on next (#170)
  • Next Build on next (#172)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc