kornelski / slip

Slip.js — UI library for manipulating lists via swipe and drag gestures
BSD 2-Clause "Simplified" License
2.44k stars 213 forks source link

adding and removing from classList instead of manually editing class #79

Closed mattgarkusha closed 8 years ago

mattgarkusha commented 8 years ago

adding and removing from classList instead of manually editing class

carter-thaxton commented 8 years ago

According to caniuse, classList isn't supported by Opera Mini or IE9 and lower. I don't think we care about either here, so I'm inclined to accept this patch.

Any objections?

carter-thaxton commented 8 years ago

Also, seems like we should also use classList.contains instead of regex.text or indexOf on className for consistency, and also to avoid exact matching issues on classes, such as matchThis vs matchThis-123. Appears we only do this in the example code, but still.

kornelski commented 8 years ago

LGTM