Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#9653 closed defect (fixed)

[PATCH][CCLA]: dijit._editor.plugins.ToggleDir: Broken on IE 6/7/8

Reported by: Jared Jurkiewicz Owned by:
Priority: high Milestone: 1.4
Component: Editor Version: 1.3.2
Keywords: Cc:
Blocked By: Blocking:

Description

dijit._editor.plugins.ToggleDir?: Broken on IE 6/7/8

While looking at editor issues, I discovered that in trunk, the ToggleDir? plugin is broken on IE. It throws an exception when running test:

http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/editor/test_ToggleDir.html

Error: Line 16 Object Required.

This occurs because the plugin assumes the document is available when initializing the button (_initButton). It is not and because of that it fails to init. This is also very easy to fix. The button connections and the like need to occur in Editor's onLoadDeferred deferred object.

I also discovered two other problems:

1.) The setting of the initial button state was actually toggling the direction too. This is wrong. It seems to be timing related to when the button emits an onChange event. It was fixed by putting a flag to catch the first trigger and ignore so that it didn't immediately toggle directions on you.

2.) The plugin didn't work right on IE at all. When it toggled RTL mode, the contents were mangled in the view. This appears to be caused by setting direction on the document, when IE needs it to be set on the body. So, special casing for IE to set on body seemed to solve that. Patch forthcoming.

Attachments (3)

ToggleDir_IE.patch (2.5 KB) - added by Jared Jurkiewicz 10 years ago.
Patch to fix the noted items.
ToggleDir_IE_2.patch (1.8 KB) - added by Jared Jurkiewicz 10 years ago.
Patch 2, based on talks with Bill.
ToggleDir_withtests.patch (4.2 KB) - added by Jared Jurkiewicz 10 years ago.
Same as patch 2 + tweak to testcase and ad of RTL Testcase.

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by Jared Jurkiewicz

Attachment: ToggleDir_IE.patch added

Patch to fix the noted items.

comment:1 Changed 10 years ago by liucougar

the first problem sounds like a bug somewhere in dijit, if so, it should be fixed in dijit

Changed 10 years ago by Jared Jurkiewicz

Attachment: ToggleDir_IE_2.patch added

Patch 2, based on talks with Bill.

Changed 10 years ago by Jared Jurkiewicz

Attachment: ToggleDir_withtests.patch added

Same as patch 2 + tweak to testcase and ad of RTL Testcase.

comment:2 Changed 10 years ago by Jared Jurkiewicz

Milestone: tbd1.4
Resolution: fixed
Status: newclosed

Fixed in checkin: [19515]

comment:3 Changed 10 years ago by Jared Jurkiewicz

(In [19527]) Tweaked it to just do rtl/ltr on body in all browsers, not just ie. Less code. refs #9653

Note: See TracTickets for help on using tickets.