|
100 | 100 | var newScrollLeft = args.getNewScrollLeft(colContainer,containerCtrl.viewport);
|
101 | 101 |
|
102 | 102 | // Make the current horizontal scroll position available in the $scope
|
103 |
| - $scope.newScrollLeft = newScrollLeft; |
| 103 | + $scope.newScrollLeft = newScrollLeft; |
104 | 104 |
|
105 | 105 | if (containerCtrl.headerViewport) {
|
106 | 106 | containerCtrl.headerViewport.scrollLeft = gridUtil.denormalizeScrollLeft(containerCtrl.headerViewport, newScrollLeft);
|
|
110 | 110 | containerCtrl.footerViewport.scrollLeft = gridUtil.denormalizeScrollLeft(containerCtrl.footerViewport, newScrollLeft);
|
111 | 111 | }
|
112 | 112 |
|
113 |
| - //scroll came from somewhere else, so the viewport must be positioned |
| 113 | + // Scroll came from somewhere else, so the viewport must be positioned |
114 | 114 | if (args.source !== ScrollEvent.Sources.ViewPortScroll) {
|
115 | 115 | containerCtrl.viewport[0].scrollLeft = newScrollLeft;
|
116 | 116 | }
|
|
189 | 189 | ret += '\n .grid' + uiGridCtrl.grid.id + ' .ui-grid-render-container-' + $scope.containerId + ' .ui-grid-canvas { width: ' + canvasWidth + 'px; height: ' + canvasHeight + 'px; }';
|
190 | 190 |
|
191 | 191 | ret += '\n .grid' + uiGridCtrl.grid.id + ' .ui-grid-render-container-' + $scope.containerId + ' .ui-grid-header-canvas { width: ' + (canvasWidth + grid.scrollbarWidth) + 'px; }';
|
| 192 | + |
| 193 | + if (renderContainer.explicitHeaderCanvasHeight) { |
| 194 | + ret += '\n .grid' + uiGridCtrl.grid.id + ' .ui-grid-render-container-' + $scope.containerId + ' .ui-grid-header-canvas { height: ' + renderContainer.explicitHeaderCanvasHeight + 'px; }'; |
| 195 | + } |
192 | 196 |
|
193 | 197 | ret += '\n .grid' + uiGridCtrl.grid.id + ' .ui-grid-render-container-' + $scope.containerId + ' .ui-grid-viewport { width: ' + viewportWidth + 'px; height: ' + viewportHeight + 'px; }';
|
194 | 198 | ret += '\n .grid' + uiGridCtrl.grid.id + ' .ui-grid-render-container-' + $scope.containerId + ' .ui-grid-header-viewport { width: ' + headerViewportWidth + 'px; }';
|
195 | 199 |
|
196 | 200 | ret += '\n .grid' + uiGridCtrl.grid.id + ' .ui-grid-render-container-' + $scope.containerId + ' .ui-grid-footer-canvas { width: ' + canvasWidth + grid.scrollbarWidth + 'px; }';
|
197 | 201 | ret += '\n .grid' + uiGridCtrl.grid.id + ' .ui-grid-render-container-' + $scope.containerId + ' .ui-grid-footer-viewport { width: ' + footerViewportWidth + 'px; }';
|
198 | 202 |
|
199 |
| - // If the render container has an "explicit" header height (such as in the case that its header is smaller than the other headers and needs to be explicitly set to be the same, ue thae) |
200 |
| - if (renderContainer.explicitHeaderCanvasHeight !== undefined && renderContainer.explicitHeaderCanvasHeight !== null && renderContainer.explicitHeaderCanvasHeight > 0) { |
201 |
| - ret += '\n .grid' + uiGridCtrl.grid.id + ' .ui-grid-render-container-' + $scope.containerId + ' .ui-grid-header-cell { min-height: ' + renderContainer.explicitHeaderCanvasHeight + 'px; }'; |
202 |
| - } |
203 |
| - // Otherwise if the render container has an INNER header height, use that on the header cells (so that all the header cells are the same height and those that have less elements don't have undersized borders) |
204 |
| - else if (renderContainer.headerCanvasHeight !== undefined && renderContainer.headerCanvasHeight !== null && renderContainer.headerCanvasHeight > 0) { |
205 |
| - ret += '\n .grid' + uiGridCtrl.grid.id + ' .ui-grid-render-container-' + $scope.containerId + ' .ui-grid-header-cell { min-height: ' + renderContainer.headerCanvasHeight + 'px; }'; |
206 |
| - } |
207 |
| - |
208 | 203 | return ret;
|
209 | 204 | }
|
210 | 205 |
|
|
220 | 215 | }]);
|
221 | 216 |
|
222 | 217 | module.controller('uiGridRenderContainer', ['$scope', 'gridUtil', function ($scope, gridUtil) {
|
223 |
| - var self = this; |
224 |
| - |
225 |
| - self.rowStyle = function (index) { |
226 |
| - var renderContainer = $scope.grid.renderContainers[$scope.containerId]; |
227 |
| - |
228 |
| - var styles = {}; |
229 |
| - |
230 |
| - if (!renderContainer.disableRowOffset) { |
231 |
| - if (index === 0 && self.currentTopRow !== 0) { |
232 |
| - // The row offset-top is just the height of the rows above the current top-most row, which are no longer rendered |
233 |
| - var hiddenRowWidth = ($scope.rowContainer.currentTopRow) * |
234 |
| - $scope.rowContainer.visibleRowCache[$scope.rowContainer.currentTopRow].height; |
235 |
| - |
236 |
| - // return { 'margin-top': hiddenRowWidth + 'px' }; |
237 |
| - //gridUtil.logDebug('margin-top ' + hiddenRowWidth ); |
238 |
| - styles['margin-top'] = hiddenRowWidth + 'px'; |
239 |
| - } |
240 |
| - } |
241 |
| - |
242 |
| - if (!renderContainer.disableColumnOffset && $scope.colContainer.currentFirstColumn !== 0) { |
243 |
| - if ($scope.grid.isRTL()) { |
244 |
| - styles['margin-right'] = $scope.colContainer.columnOffset + 'px'; |
245 |
| - } |
246 |
| - else { |
247 |
| - styles['margin-left'] = $scope.colContainer.columnOffset + 'px'; |
248 |
| - } |
249 |
| - } |
250 |
| - |
251 |
| - return styles; |
252 |
| - }; |
253 |
| - |
254 |
| - self.columnStyle = function (index) { |
255 |
| - var renderContainer = $scope.grid.renderContainers[$scope.containerId]; |
256 |
| - |
257 |
| - var self = this; |
258 |
| - |
259 |
| - if (!renderContainer.disableColumnOffset) { |
260 |
| - if (index === 0 && $scope.colContainer.currentFirstColumn !== 0) { |
261 |
| - var offset = $scope.colContainer.columnOffset; |
262 |
| - |
263 |
| - if ($scope.grid.isRTL()) { |
264 |
| - return { 'margin-right': offset + 'px' }; |
265 |
| - } |
266 |
| - else { |
267 |
| - return { 'margin-left': offset + 'px' }; |
268 |
| - } |
269 |
| - } |
270 |
| - } |
271 |
| - |
272 |
| - return null; |
273 |
| - }; |
| 218 | + |
274 | 219 | }]);
|
275 | 220 |
|
276 | 221 | })();
|
0 commit comments