]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | Ext.define('Ext.rtl.grid.ColumnLayout', {\r |
2 | override: 'Ext.grid.ColumnLayout',\r | |
3 | \r | |
4 | determineScrollbarWidth: function (ownerContext) {\r | |
5 | var me = this,\r | |
6 | view = me.owner.grid.view;\r | |
7 | \r | |
8 | me.callParent([ ownerContext ]);\r | |
9 | \r | |
10 | if (view.getInherited().rtl) {\r | |
11 | // Chrome has an RTL bug where overflow only caused by the imposition of the\r | |
12 | // vertical scrollbar does NOT cause extra left/right scrolling. If that bug is\r | |
13 | // present, this extra space is not needed in RTL.\r | |
14 | //\r | |
15 | // Safari keeps the scrollbar on the right in RTL mode so the extra width comes\r | |
16 | // from padding added to the header container.\r | |
17 | //\r | |
18 | // https://code.google.com/p/chromium/issues/detail?id=179332\r | |
19 | //\r | |
20 | // TODO: Remove the Ext.supports.rtlVertScrollbarOnRight test and the test for\r | |
21 | // it below when all supported Chrome versions are fixed.\r | |
22 | //\r | |
23 | // Chrome also has the xOriginBug:\r | |
24 | //\r | |
25 | // http://code.google.com/p/chromium/issues/detail?id=174656\r | |
26 | //\r | |
27 | // This means that the table element has to be positioned right:-15px in RTL\r | |
28 | // mode. This triggers the right padding to be added in calculateParallel below\r | |
29 | // which extends the contentWidth. We compensate for this here by reducing the\r | |
30 | // width by the same amount.\r | |
31 | //\r | |
32 | // This extra space is also not needed if the scrollbar is on the right. In\r | |
33 | // this case, the extra space comes from padding added to the ColumnLayout in\r | |
34 | // the calculateParallel implementation below.\r | |
35 | //\r | |
36 | // So when these conditions are present and the grid is in RTL mode, the\r | |
37 | // scrollbarAdjustment value for this layout is zero.\r | |
38 | \r | |
39 | if (view.bufferedRenderer && Ext.supports.xOriginBug) {\r | |
40 | me.scrollbarWidth = - Math.abs(me.scrollbarWidth);\r | |
41 | }\r | |
42 | else if (Ext.supports.rtlVertScrollbarOverflowBug ||\r | |
43 | Ext.supports.rtlVertScrollbarOnRight) {\r | |
44 | me.scrollbarWidth = 0;\r | |
45 | }\r | |
46 | }\r | |
47 | },\r | |
48 | \r | |
49 | calculateParallel: function(ownerContext, names, plan) {\r | |
50 | var me = this,\r | |
51 | owner = me.owner;\r | |
52 | \r | |
53 | if (owner.isRootHeader) {\r | |
54 | // https://sencha.jira.com/browse/EXTJSIV-11245\r | |
55 | // Safari keeps scrollbar on the right even in RTL mode, so any element\r | |
56 | // which must stay in horizontal sync (like the HeaderContainer) needs the first item to have some "before" margin.\r | |
57 | // The layout system caches the margin because it is assumed to be static, so we have to clear this cache.\r | |
58 | if ((Ext.supports.rtlVertScrollbarOnRight && owner.ownerCt.view.getInherited().rtl) ||\r | |
59 | (owner.grid.view.bufferedRenderer && Ext.supports.xOriginBug)) {\r | |
60 | me.padding.right = me.scrollbarWidth;\r | |
61 | }\r | |
62 | }\r | |
63 | \r | |
64 | return me.callParent(arguments);\r | |
65 | }\r | |
66 | });\r |