Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#16489 closed enhancement (fixed)

support has("dojo-bidi") for dijit

Reported by: bill Owned by: bill
Priority: undecided Milestone: 1.9
Component: Dijit Version: 1.8.2
Keywords: Cc: cjolif
Blocked By: Blocking:


#15778 introduced a "dojo-bidi" has() flag into dojo to be used to turn on/off support for the "textdir" parameter, via the syntax:

data-dojo-config="async: true, parseOnLoad: true,  has: {'dojo-bidi': true }

Also, you can presumably include/exclude support into builds via the staticHasFeatures setting.

The naming of the flag suggests that it controls textdir (or at least, something bidi related) for all of dojo, when in fact it's just controlling it for

Dijit currently works via a different mechanism. Support is enabled via a:


or in AMD:

require([... "dijit/_BidiSupport"], ...

This ticket is to upgrade dijit to support the has("dojo-bidi") flag introduced into dojox/mobile. This change is both for:

  • consistency between dijit and dojox/mobile
  • ability to filter out BIDI support code in various widget files (Dialog.js etc.) from a build
  • separation of concerns: separating the BIDI code for widgets from the general code, like a mixin

The change is tricky to do while maintaining backwards compatibility, particularly because apps are allowed to load dijit._BidiSupport after all the other widget modules have finished loading. But I think it can be done.

I also note that the way to enable textdir support for either dijit or dojox/mobile is not documented in the reference manual at all, except strangely for dojox/form/Calendar.

Change History (4)

comment:1 Changed 6 years ago by cjolif

Cc: cjolif added

comment:2 Changed 6 years ago by bill

Milestone: tbd1.9
Status: newassigned

comment:3 Changed 6 years ago by bill

Resolution: fixed
Status: assignedclosed

In [30240]:

Use has("dojo-bidi") flag for dijit too, same as dojox/mobile. Flag enables/disables support for textdir parameter.

This check-in also tries to untangle each widget's bidi support code from the general widget code, putting the bidi support code into a separate section of each widget's file. The bidi support code for each widget either monkey-patches the original widget class, or replaces it with a subclass. In the latter case, need to give the superclass and subclass different declaredClass names, or dojo.declare() won't work. In either case, the value returned from the module (when has("dojo-bidi") is true) is the bidi enabled class.

Also, remove lots of unneeded code from BIDI test files, unnecessarily copy-and-pasted from other test files. Plus cleanup of spacing etc.

Fixes #16489, refs #15778 !strict.

comment:19 Changed 6 years ago by cjolif

In [30272]:

refs #16489. getTextDir is now not always anymore available on a widget, fix dojox/charting/widget/Legend accordingly.

Note: See TracTickets for help on using tickets.