Skip to content

Commit 33adb1b

Browse files
committed
add support for strictNullChecks #102
1 parent 16007dc commit 33adb1b

19 files changed

+284
-165
lines changed

package-lock.json

Lines changed: 41 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-gridster2",
3-
"version": "3.11.2",
3+
"version": "3.11.3",
44
"license": "MIT",
55
"main": "dist/index.js",
66
"jsnext:main": "dist/index.js",
@@ -46,21 +46,21 @@
4646
],
4747
"dependencies": {},
4848
"devDependencies": {
49-
"@angular/animations": "4.3.4",
49+
"@angular/animations": "5.0.0-beta.3",
5050
"@angular/cdk": "2.0.0-beta.8",
5151
"@angular/cli": "1.3.0",
52-
"@angular/common": "4.3.4",
53-
"@angular/compiler": "4.3.4",
54-
"@angular/compiler-cli": "4.3.4",
55-
"@angular/core": "4.3.4",
56-
"@angular/forms": "4.3.4",
57-
"@angular/http": "4.3.4",
58-
"@angular/language-service": "4.3.4",
52+
"@angular/common": "5.0.0-beta.3",
53+
"@angular/compiler": "5.0.0-beta.3",
54+
"@angular/compiler-cli": "5.0.0-beta.3",
55+
"@angular/core": "5.0.0-beta.3",
56+
"@angular/forms": "5.0.0-beta.3",
57+
"@angular/http": "5.0.0-beta.3",
58+
"@angular/language-service": "5.0.0-beta.3",
5959
"@angular/material": "2.0.0-beta.8",
60-
"@angular/platform-browser": "4.3.4",
61-
"@angular/platform-browser-dynamic": "4.3.4",
62-
"@angular/platform-server": "4.3.4",
63-
"@angular/router": "4.3.4",
60+
"@angular/platform-browser": "5.0.0-beta.3",
61+
"@angular/platform-browser-dynamic": "5.0.0-beta.3",
62+
"@angular/platform-server": "5.0.0-beta.3",
63+
"@angular/router": "5.0.0-beta.3",
6464
"@types/jasmine": "2.5.53",
6565
"@types/node": "8.0.20",
6666
"codelyzer": "3.1.2",

src/app/app.component.ts

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core';
2-
import {GridsterConfig, GridsterItem} from '../lib/index';
2+
import {GridsterItem} from '../lib/index';
3+
import {GridsterConfigS} from '../lib/gridsterConfigS.interface';
34

45
@Component({
56
selector: 'gridster-root',
@@ -8,7 +9,7 @@ import {GridsterConfig, GridsterItem} from '../lib/index';
89
changeDetection: ChangeDetectionStrategy.OnPush
910
})
1011
export class AppComponent implements OnInit {
11-
options: GridsterConfig;
12+
options: GridsterConfigS;
1213
dashboard: Array<GridsterItem>;
1314

1415
static eventStop(item, itemComponent, event) {
@@ -56,6 +57,10 @@ export class AppComponent implements OnInit {
5657
defaultItemRows: 1,
5758
fixedColWidth: 105,
5859
fixedRowHeight: 105,
60+
keepFixedHeightInMobile: false,
61+
keepFixedWidthInMobile: false,
62+
scrollSensitivity: 10,
63+
scrollSpeed: 20,
5964
enableEmptyCellClick: false,
6065
enableEmptyCellDrop: false,
6166
enableEmptyCellDrag: false,
@@ -66,11 +71,29 @@ export class AppComponent implements OnInit {
6671
emptyCellDragMaxRows: 50,
6772
draggable: {
6873
enabled: true,
74+
ignoreContentClass: 'gridster-item-content',
75+
ignoreContent: false,
76+
dragHandleClass: 'drag-handler',
6977
stop: AppComponent.eventStop
7078
},
7179
resizable: {
7280
enabled: true,
73-
stop: AppComponent.eventStop
81+
stop: AppComponent.eventStop,
82+
handles: {
83+
s: true,
84+
e: true,
85+
n: true,
86+
w: true,
87+
se: true,
88+
ne: true,
89+
sw: true,
90+
nw: true
91+
}
92+
},
93+
api: {
94+
resize: AppComponent.eventStop,
95+
optionsChanged: AppComponent.eventStop,
96+
getNextPossiblePosition: AppComponent.eventStop,
7497
},
7598
swap: false,
7699
pushItems: true,
@@ -95,7 +118,9 @@ export class AppComponent implements OnInit {
95118
}
96119

97120
changedOptions() {
98-
this.options.api.optionsChanged();
121+
if (this.options.api && this.options.api.optionsChanged) {
122+
this.options.api.optionsChanged();
123+
}
99124
}
100125

101126
removeItem($event, item) {

0 commit comments

Comments
 (0)