Skip to content

Commit

Permalink
iteration of breaking up project
Browse files Browse the repository at this point in the history
  • Loading branch information
ceolter committed Mar 5, 2016
1 parent 30b2a0d commit 976f27e
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 10 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2015-2016 Niall Crosby
Copyright (c) 2015-2016 AG GRID LTD

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 2 additions & 0 deletions src/ts/clientExports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ export function populateClientExports(exports: any): void {

// components
exports.ComponentUtil = ComponentUtil;
exports.initialiseAgGridWithAngular1 = initialiseAgGridWithAngular1;
exports.initialiseAgGridWithWebComponents = initialiseAgGridWithWebComponents;

// context
exports.Context = Context;
Expand Down
4 changes: 2 additions & 2 deletions src/ts/grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ export class Grid {
constructor(eGridDiv: HTMLElement, gridOptions: GridOptions, globalEventListener: Function = null, $scope: any = null, $compile: any = null, quickFilterOnScope: any = null) {

if (!eGridDiv) {
console.warn('ag-Grid: no div element provided to the grid');
console.error('ag-Grid: no div element provided to the grid');
}
if (!gridOptions) {
console.warn('ag-Grid: no gridOptions provided to the grid');
console.error('ag-Grid: no gridOptions provided to the grid');
}

var virtualPaging = gridOptions.rowModelType === Constants.ROW_MODEL_TYPE_VIRTUAL;
Expand Down
30 changes: 25 additions & 5 deletions src/ts/gridPanel/gridPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,11 @@ export class GridPanel {
}

public getHorizontalScrollPosition(): number {
return this.eBodyViewport.scrollLeft;
if (this.forPrint) {
return 0;
} else {
return this.eBodyViewport.scrollLeft;
}
}

public turnOnAnimationForABit(): void {
Expand Down Expand Up @@ -957,19 +961,35 @@ export class GridPanel {
}

public getVerticalScrollPosition(): number {
return this.eBodyViewport.scrollTop;
if (this.forPrint) {
return 0;
} else {
return this.eBodyViewport.scrollTop;
}
}

public getBodyViewportClientRect(): ClientRect {
return this.eBodyViewport.getBoundingClientRect();
if (this.forPrint) {
return this.eBodyContainer.getBoundingClientRect();
} else {
return this.eBodyViewport.getBoundingClientRect();
}
}

public getFloatingTopClientRect(): ClientRect {
return this.eFloatingTop.getBoundingClientRect();
if (this.forPrint) {
return this.eFloatingTopContainer.getBoundingClientRect();
} else {
return this.eFloatingTop.getBoundingClientRect();
}
}

public getFloatingBottomClientRect(): ClientRect {
return this.eFloatingBottom.getBoundingClientRect();
if (this.forPrint) {
return this.eFloatingBottomContainer.getBoundingClientRect();
} else {
return this.eFloatingBottom.getBoundingClientRect();
}
}

public getPinnedLeftColsViewportClientRect(): ClientRect {
Expand Down
2 changes: 2 additions & 0 deletions src/ts/gridPanel/mouseEventService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {Constants} from "../constants";
import {FloatingRowModel} from "../rowControllers/floatingRowModel";
import {Utils as _} from '../utils';
import {GridCell} from "../entities/gridCell";
import {GridOptionsWrapper} from "../gridOptionsWrapper";

@Bean('mouseEventService')
export class MouseEventService {
Expand All @@ -16,6 +17,7 @@ export class MouseEventService {
@Autowired('columnController') private columnController: ColumnController;
@Autowired('rowModel') private rowModel: IRowModel;
@Autowired('floatingRowModel') private floatingRowModel: FloatingRowModel;
@Autowired('gridOptionsWrapper') private gridOptionsWrapper: GridOptionsWrapper;

public getCellForMouseEvent(mouseEvent: MouseEvent): GridCell {

Expand Down
6 changes: 4 additions & 2 deletions src/ts/rendering/renderedRow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,11 @@ export class RenderedRow {

this.destroyScope();

this.ePinnedLeftContainer.removeChild(this.ePinnedLeftRow);
this.ePinnedRightContainer.removeChild(this.ePinnedRightRow);
this.eBodyContainer.removeChild(this.eBodyRow);
if (!this.gridOptionsWrapper.isForPrint()) {
this.ePinnedLeftContainer.removeChild(this.ePinnedLeftRow);
this.ePinnedRightContainer.removeChild(this.ePinnedRightRow);
}

_.iterateObject(this.renderedCells, (key: any, renderedCell: RenderedCell)=> {
if (renderedCell) {
Expand Down
5 changes: 5 additions & 0 deletions src/ts/rowControllers/inMemory/inMemoryRowController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ export class InMemoryRowController implements IRowModel {
return this.rowsToDisplay[index];
}

public getVirtualRowCount(): number {
console.warn('ag-Grid: rowModel.getVirtualRowCount() is not longer a function, use rowModel.getRowCount() instead');
return this.getRowCount();
}

public getRowCount(): number {
if (this.rowsToDisplay) {
return this.rowsToDisplay.length;
Expand Down

0 comments on commit 976f27e

Please sign in to comment.