Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#10880 closed enhancement (fixed)

per widget dir attribute

Reported by: bill Owned by: bill
Priority: high Milestone: 1.5
Component: Dijit Version: 1.4.0
Keywords: bidi Cc:
Blocked By: Blocking:

Description

Support the dir attribute per widget, so that a single document can have some widgets in LTR mode and some in RTL mode

Change History (15)

comment:1 Changed 10 years ago by bill

Owner: set to bill
Status: newassigned

comment:2 Changed 10 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [21633]) Support per-widget dir setting. If dir is specified, widget renders in specified direction. Otherwise, it renders in the direction of the document.

Changes include:

  • move baseClass attribute from _CssStateMixinto _Widget. _Widget.postCreate() sets baseClass on _Widget.domNode
  • also set baseClass + "Rtl" class when dir=rtl
  • modified tundra's CSS selectors to use the new class names rather than depending on "dijitRtl" class on <body>
  • fixed _Widget.isLeftToRight() to obey widget's dir setting (if there is a setting) and switched widgets to call it in preference to dojo._isBodyLtr() -fixed ColorPalette? to always be in LTR mode; previously on an RTL page, clicking one color would select another

Fixes #10880 !strict

comment:3 Changed 10 years ago by bill

(In [21650]) Pass dir/lang when manually creating embedded widgets (TreeNode, TabController, TabButton, etc.). Setting dir/lang is useful to:

  • Trigger RTL CSS rules (ex: set dijitTabButtonRtl to get different styling for TabButton close icon)
  • Affect behavior (ex: whether right or left arrow key opens submenu from a PopupMenuItem)
  • Affects how browser displays text. This is usually not necessary since dir/lang settings on a node affect all subnodes. However, it's useful for popups since they have been moved under <body> and thus don't inherit the lang/dir from their logical parent (ex: a Calendar won't inherit dir/lang from the DateTextBox).

So, I'm setting it everywhere just to be safe; some of the settings are likely unneeded.

Refs #10880 !strict.

comment:4 Changed 10 years ago by bill

(In [21652]) RTL mode for ColorPalette. Since ColorPalette may now have dir=rtl set directly or indirectly, need to make sure it works. Refs #10880 !strict.

comment:5 Changed 10 years ago by bill

(In [21653]) Tweaking the test, refs #10880.

comment:6 Changed 10 years ago by bill

(In [21954]) MenuItem's also need left/right indicator, refs #10880 !strict

comment:7 Changed 10 years ago by bill

(In [21955]) Pass dir flag to edit widget created by InlineEditBox, refs #10880 !strict

comment:8 Changed 10 years ago by bill

(In [21961]) Don't call this.isLeftToRight() until after postMixInProperties()... it needs to access the parameters so it can't give an accurate result when called from the constructor. Refs #10880 !strict.

comment:9 Changed 10 years ago by bill

(In [21962]) fix dir/lang setting for buttons in editor toolbar (and thus orientation of dropdown from dropdown buttons), refs #10880 !strict

comment:10 Changed 10 years ago by bill

(In [21964]) Don't add padding to a node used to display icons from a sprite, it makes 3px of junk (from the adjacent icon) show up. Refs #10880, sort of.

comment:11 Changed 10 years ago by bill

(In [21966]) Calling this.isLeftToRight() on the MasterTooltip isn't quite right, we need to act according to the value from the !Tooltip widget that displayed the MasterTooltip, via dijit.showTooltip(). Refs #10880 !strict.

comment:12 Changed 10 years ago by bill

(In [21979]) Update grid (and enhanced grid) to support per-grid dir setting, like the dijit widgets. Refs #10880 !strict.

comment:13 Changed 10 years ago by bill

(In [21980]) When grid creates an editor based on a _Widget, pass in dir/lang settings of grid itself. Refs #10880 !strict.

comment:14 Changed 10 years ago by bill

(In [22204]) Update remaining setTooltip() calls to pass in calling widget's dir attribute, refs #10880, fixes #11173 !strict.

comment:15 Changed 8 years ago by Douglas Hays

In [27448]:

Fixes #14497. Refs #10880. Pass dir attribute to MenuItem? widgets.

Note: See TracTickets for help on using tickets.