|
274 | 274 | link: function ($scope, $elm, $attrs, uiGridCtrl) {
|
275 | 275 | var startX = 0,
|
276 | 276 | x = 0,
|
277 |
| - gridLeft = 0; |
| 277 | + gridLeft = 0, |
| 278 | + rtlMultiplier = 1; |
| 279 | + |
| 280 | + //when in RTL mode reverse the direction using the rtlMultiplier and change the position to left |
| 281 | + if (uiGridCtrl.grid.isRTL()) { |
| 282 | + $scope.position = 'left'; |
| 283 | + rtlMultiplier = -1; |
| 284 | + } |
278 | 285 |
|
279 | 286 | if ($scope.position === 'left') {
|
280 | 287 | $elm.addClass('left');
|
|
345 | 352 | var xDiff = x - startX;
|
346 | 353 |
|
347 | 354 | // Get the width that this mouse would give the column
|
348 |
| - var newWidth = col.drawnWidth + xDiff; |
| 355 | + var newWidth = parseInt(col.drawnWidth + xDiff * rtlMultiplier, 10); |
349 | 356 |
|
350 | 357 | // If the new width would be less than the column's allowably minimum width, don't allow it
|
351 | 358 | if (col.colDef.minWidth && newWidth < col.colDef.minWidth) {
|
352 |
| - x = x + (col.colDef.minWidth - newWidth); |
| 359 | + x = x + (col.colDef.minWidth - newWidth) * rtlMultiplier; |
353 | 360 | }
|
354 | 361 | else if (!col.colDef.minWidth && columnBounds.minWidth && newWidth < columnBounds.minWidth) {
|
355 | 362 | x = x + (col.colDef.minWidth - newWidth);
|
356 | 363 | }
|
357 | 364 | else if (col.colDef.maxWidth && newWidth > col.colDef.maxWidth) {
|
358 |
| - x = x + (col.colDef.maxWidth - newWidth); |
| 365 | + x = x + (col.colDef.maxWidth - newWidth) * rtlMultiplier; |
359 | 366 | }
|
360 | 367 |
|
361 | 368 | resizeOverlay.css({ left: x + 'px' });
|
|
401 | 408 | }
|
402 | 409 |
|
403 | 410 | // Get the new width
|
404 |
| - var newWidth = parseInt(col.drawnWidth + xDiff, 10); |
| 411 | + var newWidth = parseInt(col.drawnWidth + xDiff * rtlMultiplier, 10); |
405 | 412 |
|
406 | 413 | // If the new width is less than the minimum width, make it the minimum width
|
407 | 414 | if (col.colDef.minWidth && newWidth < col.colDef.minWidth) {
|
|
0 commit comments