Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#19165 closed defect (bug) (fixed)

TinyMCE throws error on mousedown (error in wpEditImage)

Reported by: joehoyle Owned by: azaozz
Priority: normal Milestone: 3.3
Component: TinyMCE Version: 3.3
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

In trunk, a JS error in thrown in your mousedown on an element that is not an image and has no child elements.

This is due to the wpEditImage mousedown handler:

if ( e.target && (e.target.nodeName == 'IMG' || e.target.firstChild.nodeName == 'IMG') ) {

Steps to reproduce:

  1. Create a new post, paste the folling into the HTML view
    <input type="text" value="foo" />
    
  1. Switch to Visual, click on the input

Observed Result:
JS Error "Uncaught TypeError: Cannot read property 'nodeName' of null"

Attached patch to fix

Attachments (1)

19165.diff​ (677 bytes ) - added by joehoyle 15 years ago.

Download all attachments as: .zip

Change History (3)

#1 @ocean90
15 years ago

  • Milestone Awaiting Review → 3.3
  • Owner set to azaozz
  • Status new → reviewing

Related: r18702

#2 @azaozz
15 years ago

  • Resolution → fixed
  • Status reviewing → closed

In [19180]:

Fix js error on mousedown in the editor, props joehoyle, fixes #19165

Note: See TracTickets for help on using tickets.