File tree 1 file changed +3
-11
lines changed
src/features/move-columns/js
1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change 439
439
//Left of cloned element should be aligned to original header cell.
440
440
movingElm . addClass ( 'movingColumn' ) ;
441
441
var movingElementStyles = { } ;
442
- var elmLeft ;
443
- if ( gridUtil . detectBrowser ( ) === 'safari' ) {
444
- //Correction for Safari getBoundingClientRect,
445
- //which does not correctly compute when there is an horizontal scroll
446
- elmLeft = $elm [ 0 ] . offsetLeft + $elm [ 0 ] . offsetWidth - $elm [ 0 ] . getBoundingClientRect ( ) . width ;
447
- }
448
- else {
449
- elmLeft = $elm [ 0 ] . getBoundingClientRect ( ) . left ;
450
- }
451
- movingElementStyles . left = ( elmLeft - gridLeft ) + 'px' ;
442
+ movingElementStyles . left = $elm [ 0 ] . offsetLeft + 'px' ;
452
443
var gridRight = $scope . grid . element [ 0 ] . getBoundingClientRect ( ) . right ;
453
444
var elmRight = $elm [ 0 ] . getBoundingClientRect ( ) . right ;
454
445
if ( elmRight > gridRight ) {
478
469
479
470
//Update css of moving column to adjust to new left value or fire scroll in case column has reached edge of grid
480
471
if ( ( currentElmLeft >= gridLeft || changeValue > 0 ) && ( currentElmRight <= rightMoveLimit || changeValue < 0 ) ) {
481
- movingElm . css ( { visibility : 'visible' , 'left' : newElementLeft + 'px' } ) ;
472
+ movingElm . css ( { visibility : 'visible' , 'left' : ( movingElm [ 0 ] . offsetLeft +
473
+ ( newElementLeft < rightMoveLimit ? changeValue : ( rightMoveLimit - currentElmLeft ) ) ) + 'px' } ) ;
482
474
}
483
475
else if ( totalColumnWidth > Math . ceil ( uiGridCtrl . grid . gridWidth ) ) {
484
476
changeValue *= 8 ;
You can’t perform that action at this time.
0 commit comments