Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#1018 closed defect (fixed)

Multiple Editor2 instances do not work properly in Firefox

Reported by: liucougar Owned by: liucougar
Priority: high Milestone:
Component: General Version: 0.3
Keywords: Cc: alex@…, paul@…
Blocked By: Blocking:

Description

in http://archive.dojotoolkit.org/nightly/tests/widget/test_Editor2.html, try select some text in the first instance of the Editor2, click "bold" button: no effect!

While select some text in the second instance, it works fine

After investigation, I think the issue is caused by the fact that this.EditNode? is not initialized when these codes are executed:

dojo.event.topic.registerPublisher("Editor2.clobberFocus", this.editNode, "onfocus");
dojo.event.topic.subscribe("Editor2.clobberFocus", this, "setBlur");
dojo.event.connect(this.editNode, "onfocus", this, "setFocus");

However, I tried several approaches to workaround this with no success. Any clues?

Attachments (1)

1018.patch (2.7 KB) - added by liucougar 13 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 13 years ago by liucougar

Owner: changed from anonymous to liucougar

Finally, I think I solved it:

Just moving the editorOnLoad() to a later stage when this.EditNode? is set correctly won't solve this: in firefox, browser specific features are used to handle onFocus event in RichText?:

560        dojo.event.browser.addListener(this.document, "focus", dojo.lang.hitch(this, "onFocus"));

So dojo.event.connect won't work anymore. Attached is a patch to rectify this: an global variable, dojo.widget.html._CurrentEditor2Instance, is introduced to save the current focused editor2 instance (this is required for Firefox as it generates a onfocus event for every click in the editing area) Editor2 overload onFocus() in RichText? now to handle setFocus correctly some Useless codes are removed as well

I also tested this patch against IE without noticable issues (I have to remove 'useActiveX="true"' in the first instance to load the page)

comment:2 Changed 13 years ago by liucougar

Status: newassigned

(sorry, the format in the previous comment seems messed up, repost it here)

So dojo.event.connect won't work anymore. Attached is a patch to rectify this:

an global variable, dojo.widget.html._CurrentEditor2Instance, is introduced to save the current focused editor2 instance (this is required for Firefox as it generates a onfocus event for every click in the editing area)

Editor2 overload onFocus() in RichText? widget now to handle setFocus correctly some Useless codes are removed as well

I also tested this patch against IE without noticable issues (I have to remove 'useActiveX="true"' in the first instance to load the page)

Changed 13 years ago by liucougar

Attachment: 1018.patch added

comment:3 Changed 13 years ago by liucougar

Resolution: fixed
Status: assignedclosed

fixed in svn r4498

comment:4 Changed 13 years ago by bill

Milestone: 0.4

comment:5 Changed 12 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.