NYTimes/backbone.stickit — pull request #55 by trabianmatt (2013-01-18 16:27:32+00:00)
Title: For discussion: Extracted overridable methods to Backbone.Stickit

Our use of stickit in titanium-backbone requires the ability to override the way elements are queried and updated. This commit moves isObservable (which replaces isFormEl($el) || isContenteditable($el)), updateEl, and getElVal to Backbone.Stickit, which can be changed by a library that uses Backbone.stickit.

For example, in titanium-backbone we can then do:

```coffeescript
_.extend Backbone.Stickit,

isObservable: ($el) ->
$el[0]._viewName in ['TextField', 'TextArea']

updateEl: ($el, val, config) ->

updateMethod = config.updateMethod || 'text';

switch $el[0]._viewName
when 'TextField', 'TextArea'
$el.val val
else
$el[updateMethod] val

getElVal: ($el) ->

switch $el[0]._viewName
when 'TextField', 'TextArea'
$el.val()
```

Is this idea worth pursuing further? I can certainly keep it in a separate fork but if others find value then I'd be happy to do any needed cleanup work (it passes all tests as-is but could probably be cleaned up a bit).