Unified · Split
| @@ -278,6 +278,12 @@ $.classify = (string) -> · 277 unmodified lines | ||
| 278 | 278 | string[i] = substr[0].toUpperCase() + substr[1..] |
| 279 | 279 | string.join('') |
| 280 | 280 | |
| 281 | +$.framify = (fn, obj) -> | |
| 282 | + if requestAnimationFrame | |
| 283 | + (args...) -> requestAnimationFrame(fn.bind(obj, args...)) | |
| 284 | + else | |
| 285 | + fn | |
| 286 | + | |
| 281 | 287 | # |
| 282 | 288 | # Miscellaneous |
| 283 | 289 | # |
| @@ -12,7 +12,9 @@ class app.views.ListFocus extends app.View · 11 unmodified lines | ||
| 12 | 12 | superEnter: 'onSuperEnter' |
| 13 | 13 | escape: 'blur' |
| 14 | 14 | |
| 15 | − constructor: (@el) -> super | |
| 15 | + constructor: (@el) -> | |
| 16 | + super | |
| 17 | + @focus = $.framify(@focus, @) | |
| 16 | 18 | |
| 17 | 19 | focus: (el) -> |
| 18 | 20 | if el and not el.classList.contains @constructor.activeClass |