File tree Expand file tree Collapse file tree 7 files changed +61
-10
lines changed Expand file tree Collapse file tree 7 files changed +61
-10
lines changed Original file line number Diff line number Diff line change 282
282
}
283
283
}
284
284
285
- var gridScrollDereg = $scope . $on ( uiGridConstants . events . GRID_SCROLL , gridScroll ) ;
286
- $scope . $on ( '$destroy' , gridScrollDereg ) ;
285
+ // var gridScrollDereg = $scope.$on(uiGridConstants.events.GRID_SCROLL, gridScroll);
286
+ // $scope.$on('$destroy', gridScrollDereg);
287
287
288
288
289
289
Original file line number Diff line number Diff line change 68
68
$elm . addClass ( 'ui-grid-render-container-' + $scope . containerId ) ;
69
69
70
70
// Bind to left/right-scroll events
71
- var scrollUnbinder ;
71
+ var scrollUnbinder = function ( ) { } ;
72
72
if ( $scope . bindScrollHorizontal || $scope . bindScrollVertical ) {
73
- scrollUnbinder = $scope . $on ( uiGridConstants . events . GRID_SCROLL , scrollHandler ) ;
73
+ // scrollUnbinder = $scope.$on(uiGridConstants.events.GRID_SCROLL, scrollHandler);
74
74
}
75
75
76
76
function scrollHandler ( evt , args ) {
404
404
$scope . rowContainer . visibleRowCache [ $scope . rowContainer . currentTopRow ] . height ;
405
405
406
406
// return { 'margin-top': hiddenRowWidth + 'px' };
407
+ //gridUtil.logDebug('margin-top ' + hiddenRowWidth );
407
408
styles [ 'margin-top' ] = hiddenRowWidth + 'px' ;
408
409
}
409
410
}
Original file line number Diff line number Diff line change @@ -1364,7 +1364,7 @@ angular.module('ui.grid')
1364
1364
1365
1365
viewPortHeight = viewPortHeight + adjustment . height ;
1366
1366
1367
- // gridUtil.logDebug('viewPortHeight', viewPortHeight);
1367
+ //gridUtil.logDebug('viewPortHeight', viewPortHeight);
1368
1368
1369
1369
return viewPortHeight ;
1370
1370
} ;
@@ -1382,7 +1382,7 @@ angular.module('ui.grid')
1382
1382
1383
1383
viewPortWidth = viewPortWidth + adjustment . width ;
1384
1384
1385
- // gridUtil.logDebug('getviewPortWidth', viewPortWidth);
1385
+ //gridUtil.logDebug('getviewPortWidth', viewPortWidth);
1386
1386
1387
1387
return viewPortWidth ;
1388
1388
} ;
@@ -1799,6 +1799,28 @@ angular.module('ui.grid')
1799
1799
}
1800
1800
} ;
1801
1801
1802
+ /**
1803
+ * @ngdoc function
1804
+ * @name hasLeftContainerColumns
1805
+ * @methodOf ui.grid.class:Grid
1806
+ * @description returns true if leftContainer has columns
1807
+ */
1808
+ Grid . prototype . hasLeftContainerColumns = function ( ) {
1809
+ return this . hasLeftContainer ( ) && this . renderContainers . left . renderedColumns . length > 0 ;
1810
+ } ;
1811
+
1812
+ /**
1813
+ * @ngdoc function
1814
+ * @name hasRightContainerColumns
1815
+ * @methodOf ui.grid.class:Grid
1816
+ * @description returns true if rightContainer has columns
1817
+ */
1818
+ Grid . prototype . hasRightContainerColumns = function ( ) {
1819
+ return this . hasRightContainer ( ) && this . renderContainers . right . renderedColumns . length > 0 ;
1820
+ } ;
1821
+
1822
+
1823
+
1802
1824
1803
1825
// Blatantly stolen from Angular as it isn't exposed (yet? 2.0?)
1804
1826
function RowHashMap ( ) { }
Original file line number Diff line number Diff line change @@ -687,6 +687,34 @@ angular.module('ui.grid')
687
687
this . columnStyles = ret ;
688
688
} ;
689
689
690
+ GridRenderContainer . prototype . getViewPortStyle = function ( ) {
691
+ var self = this ;
692
+ var styles = { } ;
693
+
694
+ if ( self . name === 'body' ) {
695
+ styles [ 'overflow-x' ] = 'scroll' ;
696
+ if ( self . grid . hasRightContainerColumns ( ) ) {
697
+ styles [ 'overflow-y' ] = 'hidden' ;
698
+ }
699
+ else {
700
+ styles [ 'overflow-y' ] = 'scroll' ;
701
+ }
702
+ }
703
+ else if ( self . name === 'left' ) {
704
+ styles [ 'overflow-x' ] = 'hidden' ;
705
+ styles [ 'overflow-y' ] = 'hidden' ;
706
+ }
707
+ else {
708
+ styles [ 'overflow-x' ] = 'hidden' ;
709
+ styles [ 'overflow-y' ] = 'scroll' ;
710
+ }
711
+
712
+ // if (self.grid.isRTL()) {
713
+
714
+ return styles ;
715
+
716
+ } ;
717
+
690
718
return GridRenderContainer ;
691
719
} ] ) ;
692
720
Original file line number Diff line number Diff line change 15
15
// overflow: auto; // TODO(c0bra): turn back on when virtual repeater is hooked up
16
16
min-height : 20px ;
17
17
position : relative ;
18
- overflow : hidden ;
19
18
20
19
:focus {
21
20
outline : none ;
24
23
25
24
.ui-grid-canvas {
26
25
position : relative ;
26
+ padding-top :1px ; // to prevent canvas from absorbing the 1st rendered row's margin
27
27
}
28
28
29
29
.ui-grid-row {
Original file line number Diff line number Diff line change 4
4
< div ui-grid-footer ng-if ="grid.options.showFooter "> </ div >
5
5
6
6
<!-- native scrolling -->
7
- < div ui-grid-native-scrollbar ng-if ="enableVerticalScrollbar " type ="vertical "> </ div >
8
- < div ui-grid-native-scrollbar ng-if ="enableHorizontalScrollbar " type ="horizontal "> </ div >
7
+ <!--< div ui-grid-native-scrollbar ng-if="enableVerticalScrollbar" type="vertical"></div>-- >
8
+ <!--< div ui-grid-native-scrollbar ng-if="enableHorizontalScrollbar" type="horizontal"></div>-- >
9
9
</ div >
Original file line number Diff line number Diff line change 1
- < div class ="ui-grid-viewport ">
1
+ < div class ="ui-grid-viewport " ng-style =" containerCtrl.colContainer.getViewPortStyle() " >
2
2
< div class ="ui-grid-canvas ">
3
3
< div ng-repeat ="(rowRenderIndex, row) in rowContainer.renderedRows track by $index " class ="ui-grid-row " ng-style ="containerCtrl.rowStyle(rowRenderIndex) ">
4
4
< div ui-grid-row ="row " row-render-index ="rowRenderIndex "> </ div >
You can’t perform that action at this time.
0 commit comments