angular-gridster2
Advanced tools
Comparing version 3.11.6 to 3.12.0
@@ -29,2 +29,3 @@ "use strict"; | ||
this.$options.emptyCellClickCallback = undefined; | ||
this.$options.emptyCellContextMenuCallback = undefined; | ||
this.$options.emptyCellDropCallback = undefined; | ||
@@ -31,0 +32,0 @@ this.$options.emptyCellDragCallback = undefined; |
@@ -40,5 +40,7 @@ "use strict"; | ||
enableEmptyCellClick: false, | ||
enableEmptyCellContextMenu: false, | ||
enableEmptyCellDrop: false, | ||
enableEmptyCellDrag: false, | ||
emptyCellClickCallback: undefined, | ||
emptyCellContextMenuCallback: undefined, | ||
emptyCellDropCallback: undefined, | ||
@@ -45,0 +47,0 @@ emptyCellDragCallback: undefined, |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"GridsterConfigService":{"gridType":"fit","fixedColWidth":250,"fixedRowHeight":250,"keepFixedHeightInMobile":false,"keepFixedWidthInMobile":false,"compactType":"none","mobileBreakpoint":640,"minCols":1,"maxCols":100,"minRows":1,"maxRows":100,"defaultItemCols":1,"defaultItemRows":1,"maxItemCols":50,"maxItemRows":50,"minItemCols":1,"minItemRows":1,"minItemArea":1,"maxItemArea":2500,"margin":10,"outerMargin":true,"scrollSensitivity":10,"scrollSpeed":20,"initCallback":{"__symbolic":"reference","name":"undefined"},"itemChangeCallback":{"__symbolic":"reference","name":"undefined"},"itemResizeCallback":{"__symbolic":"reference","name":"undefined"},"itemInitCallback":{"__symbolic":"reference","name":"undefined"},"enableEmptyCellClick":false,"enableEmptyCellDrop":false,"enableEmptyCellDrag":false,"emptyCellClickCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellDropCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellDragCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellDragMaxCols":50,"emptyCellDragMaxRows":50,"draggable":{"enabled":false,"ignoreContentClass":"gridster-item-content","ignoreContent":false,"dragHandleClass":"drag-handler","stop":{"__symbolic":"reference","name":"undefined"},"start":{"__symbolic":"reference","name":"undefined"}},"resizable":{"enabled":false,"handles":{"s":true,"e":true,"n":true,"w":true,"se":true,"ne":true,"sw":true,"nw":true},"stop":{"__symbolic":"reference","name":"undefined"},"start":{"__symbolic":"reference","name":"undefined"}},"swap":true,"pushItems":false,"pushResizeItems":false,"displayGrid":"onDrag&Resize","disableWindowResize":false}}},{"__symbolic":"module","version":1,"metadata":{"GridsterConfigService":{"gridType":"fit","fixedColWidth":250,"fixedRowHeight":250,"keepFixedHeightInMobile":false,"keepFixedWidthInMobile":false,"compactType":"none","mobileBreakpoint":640,"minCols":1,"maxCols":100,"minRows":1,"maxRows":100,"defaultItemCols":1,"defaultItemRows":1,"maxItemCols":50,"maxItemRows":50,"minItemCols":1,"minItemRows":1,"minItemArea":1,"maxItemArea":2500,"margin":10,"outerMargin":true,"scrollSensitivity":10,"scrollSpeed":20,"initCallback":{"__symbolic":"reference","name":"undefined"},"itemChangeCallback":{"__symbolic":"reference","name":"undefined"},"itemResizeCallback":{"__symbolic":"reference","name":"undefined"},"itemInitCallback":{"__symbolic":"reference","name":"undefined"},"enableEmptyCellClick":false,"enableEmptyCellDrop":false,"enableEmptyCellDrag":false,"emptyCellClickCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellDropCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellDragCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellDragMaxCols":50,"emptyCellDragMaxRows":50,"draggable":{"enabled":false,"ignoreContentClass":"gridster-item-content","ignoreContent":false,"dragHandleClass":"drag-handler","stop":{"__symbolic":"reference","name":"undefined"},"start":{"__symbolic":"reference","name":"undefined"}},"resizable":{"enabled":false,"handles":{"s":true,"e":true,"n":true,"w":true,"se":true,"ne":true,"sw":true,"nw":true},"stop":{"__symbolic":"reference","name":"undefined"},"start":{"__symbolic":"reference","name":"undefined"}},"swap":true,"pushItems":false,"pushResizeItems":false,"displayGrid":"onDrag&Resize","disableWindowResize":false}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"GridsterConfigService":{"gridType":"fit","fixedColWidth":250,"fixedRowHeight":250,"keepFixedHeightInMobile":false,"keepFixedWidthInMobile":false,"compactType":"none","mobileBreakpoint":640,"minCols":1,"maxCols":100,"minRows":1,"maxRows":100,"defaultItemCols":1,"defaultItemRows":1,"maxItemCols":50,"maxItemRows":50,"minItemCols":1,"minItemRows":1,"minItemArea":1,"maxItemArea":2500,"margin":10,"outerMargin":true,"scrollSensitivity":10,"scrollSpeed":20,"initCallback":{"__symbolic":"reference","name":"undefined"},"itemChangeCallback":{"__symbolic":"reference","name":"undefined"},"itemResizeCallback":{"__symbolic":"reference","name":"undefined"},"itemInitCallback":{"__symbolic":"reference","name":"undefined"},"enableEmptyCellClick":false,"enableEmptyCellContextMenu":false,"enableEmptyCellDrop":false,"enableEmptyCellDrag":false,"emptyCellClickCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellContextMenuCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellDropCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellDragCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellDragMaxCols":50,"emptyCellDragMaxRows":50,"draggable":{"enabled":false,"ignoreContentClass":"gridster-item-content","ignoreContent":false,"dragHandleClass":"drag-handler","stop":{"__symbolic":"reference","name":"undefined"},"start":{"__symbolic":"reference","name":"undefined"}},"resizable":{"enabled":false,"handles":{"s":true,"e":true,"n":true,"w":true,"se":true,"ne":true,"sw":true,"nw":true},"stop":{"__symbolic":"reference","name":"undefined"},"start":{"__symbolic":"reference","name":"undefined"}},"swap":true,"pushItems":false,"pushResizeItems":false,"displayGrid":"onDrag&Resize","disableWindowResize":false}}},{"__symbolic":"module","version":1,"metadata":{"GridsterConfigService":{"gridType":"fit","fixedColWidth":250,"fixedRowHeight":250,"keepFixedHeightInMobile":false,"keepFixedWidthInMobile":false,"compactType":"none","mobileBreakpoint":640,"minCols":1,"maxCols":100,"minRows":1,"maxRows":100,"defaultItemCols":1,"defaultItemRows":1,"maxItemCols":50,"maxItemRows":50,"minItemCols":1,"minItemRows":1,"minItemArea":1,"maxItemArea":2500,"margin":10,"outerMargin":true,"scrollSensitivity":10,"scrollSpeed":20,"initCallback":{"__symbolic":"reference","name":"undefined"},"itemChangeCallback":{"__symbolic":"reference","name":"undefined"},"itemResizeCallback":{"__symbolic":"reference","name":"undefined"},"itemInitCallback":{"__symbolic":"reference","name":"undefined"},"enableEmptyCellClick":false,"enableEmptyCellContextMenu":false,"enableEmptyCellDrop":false,"enableEmptyCellDrag":false,"emptyCellClickCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellContextMenuCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellDropCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellDragCallback":{"__symbolic":"reference","name":"undefined"},"emptyCellDragMaxCols":50,"emptyCellDragMaxRows":50,"draggable":{"enabled":false,"ignoreContentClass":"gridster-item-content","ignoreContent":false,"dragHandleClass":"drag-handler","stop":{"__symbolic":"reference","name":"undefined"},"start":{"__symbolic":"reference","name":"undefined"}},"resizable":{"enabled":false,"handles":{"s":true,"e":true,"n":true,"w":true,"se":true,"ne":true,"sw":true,"nw":true},"stop":{"__symbolic":"reference","name":"undefined"},"start":{"__symbolic":"reference","name":"undefined"}},"swap":true,"pushItems":false,"pushResizeItems":false,"displayGrid":"onDrag&Resize","disableWindowResize":false}}}] |
@@ -40,5 +40,7 @@ export declare type GridType = 'fit' | 'scrollVertical' | 'scrollHorizontal' | 'fixed' | 'verticalFixed' | 'horizontalFixed'; | ||
enableEmptyCellClick?: boolean; | ||
enableEmptyCellContextMenu?: boolean; | ||
enableEmptyCellDrop?: boolean; | ||
enableEmptyCellDrag?: boolean; | ||
emptyCellClickCallback?: Function; | ||
emptyCellContextMenuCallback?: Function; | ||
emptyCellDropCallback?: Function; | ||
@@ -45,0 +47,0 @@ emptyCellDragCallback?: Function; |
@@ -34,2 +34,3 @@ import { compactType, displayGrid, GridType } from './gridsterConfig.interface'; | ||
enableEmptyCellClick: boolean; | ||
enableEmptyCellContextMenu: boolean; | ||
enableEmptyCellDrop: boolean; | ||
@@ -36,0 +37,0 @@ enableEmptyCellDrag: boolean; |
@@ -7,2 +7,3 @@ import { GridsterComponent } from './gridster.component'; | ||
emptyCellClick: Function | null; | ||
emptyCellContextMenu: Function | null; | ||
emptyCellDrop: Function | null; | ||
@@ -16,2 +17,3 @@ emptyCellDrag: Function | null; | ||
emptyCellClickCb(e: any): void; | ||
emptyCellContextMenuCb(e: any): void; | ||
emptyCellDragDrop(e: any): void; | ||
@@ -18,0 +20,0 @@ emptyCellDragOver(e: any): void; |
@@ -18,2 +18,9 @@ "use strict"; | ||
} | ||
if (this.gridster.$options.enableEmptyCellContextMenu && !this.emptyCellContextMenu && this.gridster.$options.emptyCellContextMenuCallback) { | ||
this.emptyCellContextMenu = this.gridster.renderer.listen(this.gridster.el, 'contextmenu', this.emptyCellContextMenuCb.bind(this)); | ||
} | ||
else if (!this.gridster.$options.enableEmptyCellContextMenu && this.emptyCellContextMenu) { | ||
this.emptyCellContextMenu(); | ||
this.emptyCellContextMenu = null; | ||
} | ||
if (this.gridster.$options.enableEmptyCellDrop && !this.emptyCellDrop && this.gridster.$options.emptyCellDropCallback) { | ||
@@ -48,2 +55,15 @@ this.emptyCellDrop = this.gridster.renderer.listen(this.gridster.el, 'drop', this.emptyCellDragDrop.bind(this)); | ||
}; | ||
GridsterEmptyCell.prototype.emptyCellContextMenuCb = function (e) { | ||
if (this.gridster.movingItem || gridsterUtils_service_1.GridsterUtils.checkContentClassForEvent(this.gridster, e)) { | ||
return; | ||
} | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
var item = this.getValidItemFromEvent(e); | ||
if (!item) { | ||
return; | ||
} | ||
this.gridster.$options.emptyCellContextMenuCallback(e, item); | ||
this.gridster.cdRef.markForCheck(); | ||
}; | ||
GridsterEmptyCell.prototype.emptyCellDragDrop = function (e) { | ||
@@ -50,0 +70,0 @@ var item = this.getValidItemFromEvent(e); |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"GridsterEmptyCell":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./gridster.component","name":"GridsterComponent"}]}],"updateOptions":[{"__symbolic":"method"}],"emptyCellClickCb":[{"__symbolic":"method"}],"emptyCellDragDrop":[{"__symbolic":"method"}],"emptyCellDragOver":[{"__symbolic":"method"}],"emptyCellMouseDown":[{"__symbolic":"method"}],"emptyCellMouseMove":[{"__symbolic":"method"}],"emptyCellMouseUp":[{"__symbolic":"method"}],"getValidItemFromEvent":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"GridsterEmptyCell":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./gridster.component","name":"GridsterComponent"}]}],"updateOptions":[{"__symbolic":"method"}],"emptyCellClickCb":[{"__symbolic":"method"}],"emptyCellDragDrop":[{"__symbolic":"method"}],"emptyCellDragOver":[{"__symbolic":"method"}],"emptyCellMouseDown":[{"__symbolic":"method"}],"emptyCellMouseMove":[{"__symbolic":"method"}],"emptyCellMouseUp":[{"__symbolic":"method"}],"getValidItemFromEvent":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"GridsterEmptyCell":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./gridster.component","name":"GridsterComponent"}]}],"updateOptions":[{"__symbolic":"method"}],"emptyCellClickCb":[{"__symbolic":"method"}],"emptyCellContextMenuCb":[{"__symbolic":"method"}],"emptyCellDragDrop":[{"__symbolic":"method"}],"emptyCellDragOver":[{"__symbolic":"method"}],"emptyCellMouseDown":[{"__symbolic":"method"}],"emptyCellMouseMove":[{"__symbolic":"method"}],"emptyCellMouseUp":[{"__symbolic":"method"}],"getValidItemFromEvent":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"GridsterEmptyCell":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"./gridster.component","name":"GridsterComponent"}]}],"updateOptions":[{"__symbolic":"method"}],"emptyCellClickCb":[{"__symbolic":"method"}],"emptyCellContextMenuCb":[{"__symbolic":"method"}],"emptyCellDragDrop":[{"__symbolic":"method"}],"emptyCellDragOver":[{"__symbolic":"method"}],"emptyCellMouseDown":[{"__symbolic":"method"}],"emptyCellMouseMove":[{"__symbolic":"method"}],"emptyCellMouseUp":[{"__symbolic":"method"}],"getValidItemFromEvent":[{"__symbolic":"method"}]}}}}] |
{ | ||
"name": "angular-gridster2", | ||
"version": "3.11.6", | ||
"version": "3.12.0", | ||
"license": "MIT", | ||
@@ -65,3 +65,3 @@ "main": "dist/index.js", | ||
"@types/jasmine": "2.5.54", | ||
"@types/node": "8.0.24", | ||
"@types/node": "8.0.25", | ||
"codelyzer": "3.1.2", | ||
@@ -73,3 +73,3 @@ "core-js": "2.5.0", | ||
"hammerjs": "2.0.8", | ||
"jasmine-core": "2.7.0", | ||
"jasmine-core": "2.8.0", | ||
"jasmine-spec-reporter": "4.2.1", | ||
@@ -88,3 +88,3 @@ "karma": "1.7.0", | ||
"tslib": "1.7.1", | ||
"tslint": "5.6.0", | ||
"tslint": "5.7.0", | ||
"typescript": "2.4.2", | ||
@@ -91,0 +91,0 @@ "zone.js": "0.8.17" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
278421
2780