sproutcore / rich-text-editor

A rich text editor for SproutCore.
Other
6 stars 6 forks source link

Clicking links in the editor view do not direct to new window location #23

Closed mysterlune closed 10 years ago

mysterlune commented 10 years ago

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.

mysterlune commented 10 years ago

This should be PR'd from a branch, not our fork of master ;) Closing this one...

mysterlune commented 10 years ago

Added new PR here: https://github.com/sproutcore/rich-text-editor/pull/24