antipalos / antipalos.github.io

Σελίδες γνώσης
4 stars 5 forks source link

#18 Fixed and prettyfied some NumPad stuff #24

Closed vsubhuman closed 6 years ago

vsubhuman commented 6 years ago
  1. Switched NumPad init to separate small button near each input-field. This will allow users who don't want to use it - to use default fields as usual. Buttons are only displayed in isMobile mode.
  2. Simplified isMobile flag to display width check. This seems to be more reliable and will affect small-screen devices even if they are not "officially" mobile.
  3. Found out some events were processed twice (arrows are keyups on input fields). Added some special cases to remove this duplication.
  4. Default NumPad was acting really weird with the target element and onClose event, so added some fixes to the library itself. Now fake target is passed so value setting is processed manually in the onClose function which now accepts a flag if this close means done or cancel.
  5. Extracted some common functions and added "cleave" formatting to the numpad in real-time.
  6. Reworked the numpad layout. Removed +- button at all. Moved Ok/Cancel buttons to the bottom footer. Added up/down arrow buttons to increment/decrement the value.
  7. Replaced nutton text with unicode graphics. Seem to be multinationally obvious enough to not require additional future translation.
  8. Added in-place validation for min-max values and error-indication
vsubhuman commented 6 years ago

NumPad seems to be good to go at this point. Main js files still requires some heavy refactoring (too big, lots of stuff mixed together). I want to extract the whole input-fields formatting thing into separate library (cleave, numpad, locales) to reuse it in the webdev and other projects. Prolly gonna do it after next small release.