prajwalkman / angular-slider

(DEPRECATED) Slider directive implementation for AngularJS, without jQuery dependencies
http://prajwalkman.github.io/angular-slider
MIT License
249 stars 177 forks source link

Script crashes if clientX === 0 without touch screen #49

Open perqa opened 10 years ago

perqa commented 10 years ago

On row 262: eventX = event.clientX || event.touches[0].clientX;

When event.clientX === 0, it is considered false, and event.touches[0] are used instead. However, on a desktop, event.touches don't exist, so the script crashes with the message: "Uncaught TypeError: Cannot read property '0' of undefined".