<!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 "left" and "right" 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 ==> 0100 = 4
|
rtl[2] = ltr[2]; // 0010 = 2 ==> same
|
rtl[3] = ltr[6]; // 0011 = 3 ==> 0110 = 6
|
rtl[4] = ltr[1]; // 0100 = 4 ==> 0001 = 1
|
rtl[5] = ltr[5]; // 0101 = 5 ==> same
|
rtl[6] = ltr[3]; // 0110 = 6 ==> 0011 = 3
|
rtl[7] = ltr[7]; // 0111 = 7 ==> same
|
rtl[8] = ltr[8]; // 1000 = 8 ==> same
|
rtl[9] = ltr[12]; // 1001 = 9 ==> 1100 = 12
|
rtl[10] = ltr[10]; // 1010 = 10 ==> same
|
rtl[11] = ltr[14]; // 1011 = 11 ==> 1110 = 14
|
rtl[12] = ltr[9]; // 1100 = 12 ==> 1001 = 9
|
rtl[13] = ltr[13]; // 1101 = 13 ==> same
|
rtl[14] = ltr[11]; // 1110 = 14 ==> 1011 = 11
|
rtl[15] = ltr[15]; // 1111 = 15 ==> same
|
}
|
});
|
</pre>
|
</body>
|
</html>
|