13693261870
2022-09-16 354b3dbfbffb3df45212a2a44dbbf48b4acc2594
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  <style type="text/css">
    .highlight { display: block; background-color: #ddd; }
  </style>
  <script type="text/javascript">
    function highlight() {
      document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
    }
  </script>
</head>
<body onload="prettyPrint(); highlight();">
  <pre class="prettyprint lang-js"><span id='Ext-rtl-layout-component-Dock'>/**
</span> * @override Ext.rtl.layout.component.Dock
 * This override adds RTL support to Ext.layout.component.Dock.
 */
Ext.define('Ext.rtl.layout.component.Dock', {
    override: 'Ext.layout.component.Dock',
 
<span id='Ext-rtl-layout-component-Dock-property-rtlPositions'>    rtlPositions: {
</span>        top: 'top',
        right: 'left',
        bottom: 'bottom',
        left: 'right'
    },
 
<span id='Ext-rtl-layout-component-Dock-method-getDockCls'>    getDockCls: function(dock) {
</span>        // When in RTL mode it is necessary to reverse &quot;left&quot; and &quot;right&quot; css class names.
        // We have to do it this way (as opposed to using css overrides) because of the
        // !important border-width rules, e.g.:
        // .x-docked-left { border-right-width: 0 !important; }
        return 'docked-' +
            (this.owner.getHierarchyState().rtl ? this.rtlPositions[dock] : dock);
    },
 
<span id='Ext-rtl-layout-component-Dock-method-getBorderClassTable'>    // Neptune + RTL :)
</span>
    getBorderClassTable: function () {
        var me = this;
 
        if (!me.borderTablesInited) {
            me.initBorderTables();
        }
 
        return me.owner.getHierarchyState().rtl ? me.noBorderClassTableRtl
                                                : me.noBorderClassTableLtr;
    },
 
<span id='Ext-rtl-layout-component-Dock-method-getBorderCollapseTable'>    getBorderCollapseTable: function () {
</span>        var me = this,
            table = me.callParent();
 
        if (!table.rtl) {
            me.setupBorderTable(table, table.rtl = []);
        }
 
        return me.owner.getHierarchyState().rtl ? table.rtl : table;
    },
 
<span id='Ext-rtl-layout-component-Dock-method-initBorderTables'>    initBorderTables: function () {
</span>        var me = Ext.layout.component.Dock.prototype,
            ltr = me.noBorderClassTable,
            rtl = [];
 
        me.setupBorderTable(ltr, rtl);
 
        me.noBorderClassTableLtr = ltr;
        me.noBorderClassTableRtl = rtl;
 
        me.borderTablesInited = true;
    },
 
<span id='Ext-rtl-layout-component-Dock-method-setupBorderTable'>    setupBorderTable: function (ltr, rtl) {
</span>                            // TRBL
        rtl[0]  = ltr[0];   // 0000
        rtl[1]  = ltr[4];   // 0001 = 1   ==&gt; 0100 = 4
        rtl[2]  = ltr[2];   // 0010 = 2   ==&gt; same
        rtl[3]  = ltr[6];   // 0011 = 3   ==&gt; 0110 = 6
        rtl[4]  = ltr[1];   // 0100 = 4   ==&gt; 0001 = 1
        rtl[5]  = ltr[5];   // 0101 = 5   ==&gt; same
        rtl[6]  = ltr[3];   // 0110 = 6   ==&gt; 0011 = 3
        rtl[7]  = ltr[7];   // 0111 = 7   ==&gt; same
        rtl[8]  = ltr[8];   // 1000 = 8   ==&gt; same
        rtl[9]  = ltr[12];  // 1001 = 9   ==&gt; 1100 = 12
        rtl[10] = ltr[10];  // 1010 = 10  ==&gt; same
        rtl[11] = ltr[14];  // 1011 = 11  ==&gt; 1110 = 14
        rtl[12] = ltr[9];   // 1100 = 12  ==&gt; 1001 = 9
        rtl[13] = ltr[13];  // 1101 = 13  ==&gt; same
        rtl[14] = ltr[11];  // 1110 = 14  ==&gt; 1011 = 11
        rtl[15] = ltr[15];  // 1111 = 15  ==&gt; same
    }
});
</pre>
</body>
</html>