Conversation
Update gulpfile.js to build from src folder into scripts Fix gulpfile.js to minify both rateit.js and jquery.rateit.js
Bug fixes: - Fix keyboard down-arrow using 'element' (string) instead of 'item' (HTMLElement) - broken since initial implementation - Fix calcRawScore using global 'event' object instead of 'ev' parameter for touch/mouse detection - Fix options() getter returning all values as strings, causing ispreset string "false" to be truthy and breaking reset button logic - Fix value(el, null) not resetting to min (now mirrors jQuery version behaviour) - Fix event listeners being bound unconditionally on readonly widgets (mousemove/mouseup/keyup now only bound when not readonly) - Fix no guard against re-initialising already-initialised elements (enable() now calls redraw() and skips if init data present) New features: - Add DOMContentLoaded auto-initialisation for all .rateit elements (mirrors jQuery plugin behaviour) Build: - Compile src/rateit.ts to scripts/rateit.js (UMD module format, ES5 target) - Update tsconfig.json: fix file reference from ./scripts/rateit.ts to ./src/rateit.ts, change module to umd - Update gulpfile.js: pass module: 'umd' to typescript compiler https://claude.ai/code/session_01HKMsCrHeceW42kMUtcJTCv
|
I had a look and the pr looks great. A couple of things.. Comparing it to what I have: a) If I don't supply a min value: later on the width calculation goes NaN : Adding a check on the options.min / max fixes it. ie || 0 dataset.set('min', isNaN(dataset.getNumber('min')) ? options.min || 0 : dataset.getNumber('min')); b) Won't show my reset button, as I don't supply a default. I think the jq version options extended defaults and then overriden on startup. So always had a default value. c) I could not get it to run, ie work out how to initialise it on my page. Maybe need to use require(..) or something as its a module? I fudged the exports to make it work. Thanks |
No description provided.