Last change
on this file since 529 was
483,
checked in by hendrikvanantwerpen, 11 years ago
|
Added Dojo 1.9.3 release.
|
File size:
1.4 KB
|
Line | |
---|
1 | define([ |
---|
2 | "dojo/_base/declare", |
---|
3 | "dojo/_base/window", |
---|
4 | "dojo/_base/array", |
---|
5 | "dojo/dom-construct", |
---|
6 | "./common" |
---|
7 | ], function(declare, win, array, domConstruct, common){ |
---|
8 | |
---|
9 | // module: |
---|
10 | // dojox/mobile/bidi/SpinWheelSlot |
---|
11 | |
---|
12 | return declare(null, { |
---|
13 | // summary: |
---|
14 | // Support for control over text direction for mobile SpinWheelSlot widget, using Unicode Control Characters to control text direction. |
---|
15 | // description: |
---|
16 | // This class should not be used directly. |
---|
17 | // Mobile SpinWheelSlot widget loads this module when user sets "has: {'dojo-bidi': true }" in data-dojo-config. |
---|
18 | postCreate: function(){ |
---|
19 | this.inherited(arguments); |
---|
20 | if(!this.textDir && this.getParent() && this.getParent().get("textDir")){ |
---|
21 | this.set("textDir", this.getParent().get("textDir")); |
---|
22 | } |
---|
23 | }, |
---|
24 | |
---|
25 | _setTextDirAttr: function(textDir){ |
---|
26 | if(textDir && (!this._created || this.textDir !== textDir)){ |
---|
27 | this.textDir = textDir; |
---|
28 | this._setTextDirToNodes(this.textDir); |
---|
29 | } |
---|
30 | }, |
---|
31 | |
---|
32 | _setTextDirToNodes: function(textDir){ |
---|
33 | array.forEach(this.panelNodes, function(panel){ |
---|
34 | array.forEach(panel.childNodes, function(node, i){ |
---|
35 | node.innerHTML = common.removeUCCFromText(node.innerHTML); |
---|
36 | node.innerHTML = common.enforceTextDirWithUcc(node.innerHTML, this.textDir); |
---|
37 | node.style.textAlign = (this.dir.toLowerCase() === "rtl") ? "right" : "left"; |
---|
38 | }, this); |
---|
39 | }, this); |
---|
40 | } |
---|
41 | }); |
---|
42 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.