Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 8ab7dd9

Browse files
hosseinkhaledimmalerba
authored andcommitted
fix(gridList): RTL Layout (#2996) (#10178)
1 parent ed10a6e commit 8ab7dd9

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/components/gridList/grid-list.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,17 @@ function GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia) {
270270

271271
// The width and horizontal position of each tile is always calculated the same way, but the
272272
// height and vertical position depends on the rowMode.
273-
var style = {
274-
left: POSITION({ unit: hUnit, offset: position.col, gutter: gutter }),
273+
var ltr = document.dir != 'rtl' && document.body.dir != 'rtl';
274+
var style = ltr ? {
275+
left: POSITION({ unit: hUnit, offset: position.col, gutter: gutter }),
276+
width: DIMENSION({ unit: hUnit, span: spans.col, gutter: gutter }),
277+
// resets
278+
paddingTop: '',
279+
marginTop: '',
280+
top: '',
281+
height: ''
282+
} : {
283+
right: POSITION({ unit: hUnit, offset: position.col, gutter: gutter }),
275284
width: DIMENSION({ unit: hUnit, span: spans.col, gutter: gutter }),
276285
// resets
277286
paddingTop: '',

0 commit comments

Comments
 (0)