powmedia/backbone-forms — pull request #412 by iabw (2014-08-27 15:28:17+00:00)
Title: Add disable/enable methods to field

This adds enable and disable methods to the Field class. The goal is to stream-line disabling editors, instead of having to use your editor's CSS selector on the page.

These methods will attempt to call any enable/disable on the editor (like focus/blur). These methods are NOT required, but are useful for custom editors that might have more complicated disable/enable scenarios. (fe - an Autocomplete that should close its options when disabled).

If the editor doesn't have the method, the field's disable/enable methods will disable all inputs in the editor.$el, or the editor.$el itself, if it is an input as with Text Editor. ( This 'default' logic branch might make more sense as default disable/enable methods on the Base editor class )

This is useful for Checkboxes, Radios, and the default List Text editor.

However, the 'all inputs' approach might be too naive. For example, these methods currently do nothing to TextArea or Select editors.