sproutcore/rich-text-editor — pull request #24 by mysterlune (2014-11-17 23:43:29+00:00)
Title: Allows for link clicks to trigger when editor is not first responder

Allows for link clicks to trigger a window.open call to target _blank. Currently, clicking a link simply puts the editor into isFirstResponder, which is not consistent with user expectation.

The approach here is to simply modify the editor's mouseDown event handler to detect whether the event.target is an anchor tag AND whether the editor has isFirstResponder.

A user story here might be "As a user, if I click a link in the editor while NOT editing content, the link should open a new window/tab and display the linked webpage." And "... if I click a link while IN editing mode, place the caret within the link text so that I can modify the link using the toolbar tool, if needed."

Unit test provided.