Skip to content
Snippets Groups Projects
  1. Mar 31, 2017
    • Alexandre Bonneau's avatar
      Fix issue #427 `autoUnformat()` converts `digitGroupSeparator` set to `.` as the decimal character · ba6ad60b
      Alexandre Bonneau authored
      
      Modify `AutoNumeric.unformat()` so that 'real' javascript number are always directly returned, without taking into account the options passed (as it was supposed to do previously).
      Correctly take into account the number of decimal places, the negative brackets, rounding and the suffix text options when unformatting with `AutoNumeric.unformat()`.
      Complete the `AutoNumeric.unformat()` unit tests.
      Modify `_removeBrackets()` so that we can only remove the brackets, without reordering the negative sign, currency symbol and value according to the settings.
      
      Signed-off-by: default avatarAlexandre Bonneau <alexandre.bonneau@linuxfr.eu>
    • Alexandre Bonneau's avatar
      Fix issue #414 Changing the value of an element from negative to positive is... · bffa8f48
      Alexandre Bonneau authored
      Fix issue #414 Changing the value of an element from negative to positive is not possible for some specific configuration of brackets, for the second time.
      
      Remove the need to keep an ambiguous `settings.trailingNegative` variable, that was used for other things that its names suggests.
      Extract the `_isTrailingNegative` test to its own function.
      Fix `_convertToNumericString()` to make it remove the `suffixText` as well.
      Use array destructuring to simplify the `_setValueParts()` function.
      Remove the attribute `newValue` polluting `this`, which allow to explicitly pass the needed information.
      Merge `this.settings.hasFocus` into `this.isFocused`.
      Remove the need for the `this.settings.strip` variable.
      Modify the event listener from `'focusin'` to `'focus'`, in order to prepare for the merge of `_onFocusInAndMouseEnter()` and `_onFocus()` handlers.
      Modify `_cleanLeadingTrailingZeros()` so that the trailing zeroes if correctly done, even if `leadingZero` is set to `keep`.
      Rename `_cleanLeadingTrailingZeros()` to `_trimLeadingAndTrailingZeros()`.
      Change the `_addGroupSeparators()` signature so that the focused state is explicitly passed as a parameter, instead of piggy-backing on the settings object.
      Add a `_setTrailingNegativeSignInfo()` function that parse the settings and initialize once the `this.isTrailingNegative` property if the negative sign should be trailing for negative values.
      Rename the `leftOrAll` parameter from `_stripAllNonNumberCharacters()` to a more meaningful `stripZeros`.
      Simplify a test in `_truncateDecimalPlaces()`.
      Rename `_skipAlways()` to `_processNonPrintableKeysAndShortcuts()`.
      Add cases to the helper function `isNegative()` to make it more efficient.
      Add a new `isNegativeWithBrackets()` helper function that tests if the given value is a negative with brackets.
      
      Signed-off-by: default avatarAlexandre Bonneau <alexandre.bonneau@linuxfr.eu>
  2. Mar 28, 2017
  3. Mar 26, 2017
  4. Mar 25, 2017
  5. Mar 24, 2017
  6. Mar 19, 2017
  7. Mar 18, 2017
  8. Mar 17, 2017
  9. Mar 16, 2017
    • Alexandre Bonneau's avatar
      Add unit tests for the new `global.*` features · a5fc577e
      Alexandre Bonneau authored
      
      Fix issue #412 Using `set('')` does not respect the `emptyInputBehavior` option when it's set to `'always'`
      Add a `createLocalList` option which allow to control whether a local list of AutoNumeric objects should be saved on initializations.
      Add a `global.update()` function to update the settings on a local list.
      Modify the `global.clear()` function to be able to force a `clear` call.
      Add a `global.nuke()` function to `remove` then delete the local list DOM element from the DOM.
      Update the `global.clear()` function signature with the `clear()` one.
      Fix the `global.addObject()` function that did not update the local list of the added element.
      Fix the `global.addObject()` function so that if it add an AutoNumeric object that already has a local list with multiple other AutoNumeric objects, it merges the list.
      Fix the `global.removeObject()` function to make it update all the objects local list. Also add special behaviors when an AutoNumeric element removes itself or another one.
      Fix the `global.empty()` function to match the `removeObject` behavior.
      Simplify the `init()` method by removing a negation in one of its parameter.
      Fix the `init()` method initialization process by preventing creating a local list, then removing it immediately if the user wanted a detached element. Now, the local list is just not created (Using the `createLocalList` option set to `false`).
      Add an end-to-end test for the `remove()` method.
      Add a `_hasLocalList()` method that tests if the AutoNumeric element has a local list and that it has at least one element in it (itself usually).
      
      Signed-off-by: default avatarAlexandre Bonneau <alexandre.bonneau@linuxfr.eu>
  10. Mar 14, 2017
  11. Mar 10, 2017
  12. Mar 09, 2017
  13. Mar 08, 2017
  14. Mar 07, 2017
  15. Mar 06, 2017
  16. Mar 03, 2017
Loading