Unified · Split
| @@ -278,6 +278,12 @@ $.classify = (string) -> · 277 unmodified lines | |||
| 278 | string[i] = substr[0].toUpperCase() + substr[1..] | 278 | string[i] = substr[0].toUpperCase() + substr[1..] |
| 279 | string.join('') | 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 | # Miscellaneous | 288 | # Miscellaneous |
| 283 | # | 289 | # |
| @@ -12,7 +12,9 @@ class app.views.ListFocus extends app.View · 11 unmodified lines | |||
| 12 | superEnter: 'onSuperEnter' | 12 | superEnter: 'onSuperEnter' |
| 13 | escape: 'blur' | 13 | escape: 'blur' |
| 14 | 14 | ||
| 15 | constructor: (@el) -> super | 15 | constructor: (@el) -> |
| 16 | super | ||
| 17 | @focus = $.framify(@focus, @) | ||
| 16 | 18 | ||
| 17 | focus: (el) -> | 19 | focus: (el) -> |
| 18 | if el and not el.classList.contains @constructor.activeClass | 20 | if el and not el.classList.contains @constructor.activeClass |