adobe/brackets — pull request #2285 by njx (2012-12-06 01:47:05+00:00)
Title: Factor out width-resizing logic for inline widgets into the InlineWidget base class

This addresses #2221 and #2218.

As part of this, cleaned up some issues around how we're doing inheritance:

* For #872, switched to using `Object.create()` to hook up prototypes
(this avoids subtle bugs when binding event handlers in base classes).
* Made it so all child classes call base class implementation for overridden functions
(even if the base class impl is empty right now). The one exception is `close()`, which
is a bit weird right now.

The issue with `close()` is that the base version in InlineWidget seems to assume that there is an `_editorHasFocus()` method on `this`, but InlineWidget doesn't actually define one. Need to figure out if this should be given a default implementation that just returns `true`. If so, then we could just eliminate `close()` from InlineImageWidget, and the dummy `_editorHasFocus()` implementation on InlineColorEditor.