]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | Ext.define('Ext.rtl.util.Renderable', {\r |
2 | override: 'Ext.util.Renderable',\r | |
3 | \r | |
4 | _rtlCls: Ext.baseCSSPrefix + 'rtl',\r | |
5 | _ltrCls: Ext.baseCSSPrefix + 'ltr',\r | |
6 | \r | |
7 | // this template should be exactly the same as frameTableTpl, except with the order\r | |
8 | // of right and left TD elements switched.\r | |
9 | rtlFrameTableTpl: [\r | |
10 | '{%this.renderDockedItems(out,values,0);%}',\r | |
11 | '<table id="{fgid}Table" data-ref="frameTable" class="{frameCls} ', Ext.baseCSSPrefix + 'table-plain" cellpadding="0" role="presentation">',\r | |
12 | '<tpl if="top">',\r | |
13 | '<tr role="presentation">',\r | |
14 | '<tpl if="right"><td id="{fgid}TR" data-ref="frameTR" class="{frameCls}-tr {baseCls}-tr {baseCls}-{ui}-tr<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-tr</tpl>{frameElCls}" role="presentation"></td></tpl>',\r | |
15 | '<td id="{fgid}TC" data-ref="frameTC" class="{frameCls}-tc {baseCls}-tc {baseCls}-{ui}-tc<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-tc</tpl>{frameElCls}" role="presentation"></td>',\r | |
16 | '<tpl if="left"><td id="{fgid}TL" data-ref="frameTL" class="{frameCls}-tl {baseCls}-tl {baseCls}-{ui}-tl<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-tl</tpl>{frameElCls}" role="presentation"></td></tpl>',\r | |
17 | '</tr>',\r | |
18 | '</tpl>',\r | |
19 | '<tr role="presentation">',\r | |
20 | '<tpl if="right"><td id="{fgid}MR" data-ref="frameMR" class="{frameCls}-mr {baseCls}-mr {baseCls}-{ui}-mr<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-mr</tpl>{frameElCls}" role="presentation"></td></tpl>',\r | |
21 | '<td id="{fgid}Body" data-ref="frameBody" class="{frameBodyCls} {frameCls}-mc {baseCls}-mc {baseCls}-{ui}-mc<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-mc</tpl>{frameElCls}" style="{mcStyle}" role="presentation">',\r | |
22 | '{%this.applyRenderTpl(out, values)%}',\r | |
23 | '</td>',\r | |
24 | '<tpl if="left"><td id="{fgid}ML" data-ref="frameML" class="{frameCls}-ml {baseCls}-ml {baseCls}-{ui}-ml<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-ml</tpl>{frameElCls}" role="presentation"></td></tpl>',\r | |
25 | '</tr>',\r | |
26 | '<tpl if="bottom">',\r | |
27 | '<tr role="presentation">',\r | |
28 | '<tpl if="right"><td id="{fgid}BR" data-ref="frameBR" class="{frameCls}-br {baseCls}-br {baseCls}-{ui}-br<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-br</tpl>{frameElCls}" role="presentation"></td></tpl>',\r | |
29 | '<td id="{fgid}BC" data-ref="frameBC" class="{frameCls}-bc {baseCls}-bc {baseCls}-{ui}-bc<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-bc</tpl>{frameElCls}" role="presentation"></td>',\r | |
30 | '<tpl if="left"><td id="{fgid}BL" data-ref="frameBL" class="{frameCls}-bl {baseCls}-bl {baseCls}-{ui}-bl<tpl for="uiCls"> {parent.baseCls}-{parent.ui}-{.}-bl</tpl>{frameElCls}" role="presentation"></td></tpl>',\r | |
31 | '</tr>',\r | |
32 | '</tpl>',\r | |
33 | '</table>',\r | |
34 | '{%this.renderDockedItems(out,values,1);%}'\r | |
35 | ],\r | |
36 | \r | |
37 | beforeRender: function() {\r | |
38 | var rtl = this.getInherited().rtl;\r | |
39 | if (rtl) {\r | |
40 | this.addCls(this._rtlCls);\r | |
41 | } else if (rtl === false) {\r | |
42 | this.addCls(this._ltrCls);\r | |
43 | }\r | |
44 | \r | |
45 | this.callParent();\r | |
46 | },\r | |
47 | \r | |
48 | initRenderData: function() {\r | |
49 | var me = this,\r | |
50 | renderData = me.callParent(),\r | |
51 | rtlCls = me._rtlCls;\r | |
52 | \r | |
53 | if (rtlCls && me.getInherited().rtl) {\r | |
54 | renderData.childElCls = ' ' + rtlCls;\r | |
55 | }\r | |
56 | \r | |
57 | return renderData;\r | |
58 | },\r | |
59 | \r | |
60 | privates: {\r | |
61 | getFrameTpl: function(table) {\r | |
62 | return (table && this.getInherited().rtl) ?\r | |
63 | this.getTpl('rtlFrameTableTpl') : this.callParent(arguments);\r | |
64 | },\r | |
65 | \r | |
66 | getFrameRenderData: function () {\r | |
67 | var me = this,\r | |
68 | data = me.callParent(),\r | |
69 | rtlCls = me._rtlCls;\r | |
70 | \r | |
71 | if (rtlCls && me.getInherited().rtl) {\r | |
72 | data.frameElCls = ' ' + rtlCls;\r | |
73 | }\r | |
74 | \r | |
75 | return data;\r | |
76 | }\r | |
77 | }\r | |
78 | });\r |