45 lines
2.4 KiB
Diff
45 lines
2.4 KiB
Diff
|
|
diff --git a/node_modules/angular-gridster2/fesm2020/angular-gridster2.mjs b/node_modules/angular-gridster2/fesm2020/angular-gridster2.mjs
|
||
|
|
index cf4e220..4275d11 100644
|
||
|
|
--- a/node_modules/angular-gridster2/fesm2020/angular-gridster2.mjs
|
||
|
|
+++ b/node_modules/angular-gridster2/fesm2020/angular-gridster2.mjs
|
||
|
|
@@ -208,6 +208,7 @@ const GridsterConfigService = {
|
||
|
|
useTransformPositioning: true,
|
||
|
|
scrollSensitivity: 10,
|
||
|
|
scrollSpeed: 20,
|
||
|
|
+ colWidthUpdateCallback: undefined,
|
||
|
|
initCallback: undefined,
|
||
|
|
destroyCallback: undefined,
|
||
|
|
gridSizeChangedCallback: undefined,
|
||
|
|
@@ -1243,6 +1244,9 @@ class GridsterComponent {
|
||
|
|
this.renderer.setStyle(this.el, 'padding-right', this.$options.margin + 'px');
|
||
|
|
}
|
||
|
|
this.curColWidth = (this.curWidth - marginWidth) / this.columns;
|
||
|
|
+ if (this.options.colWidthUpdateCallback) {
|
||
|
|
+ this.curColWidth = this.options.colWidthUpdateCallback(this.curColWidth);
|
||
|
|
+ }
|
||
|
|
let marginHeight = -this.$options.margin;
|
||
|
|
if (this.$options.outerMarginTop !== null) {
|
||
|
|
marginHeight += this.$options.outerMarginTop;
|
||
|
|
@@ -1266,6 +1270,9 @@ class GridsterComponent {
|
||
|
|
}
|
||
|
|
else {
|
||
|
|
this.curColWidth = (this.curWidth + this.$options.margin) / this.columns;
|
||
|
|
+ if (this.options.colWidthUpdateCallback) {
|
||
|
|
+ this.curColWidth = this.options.colWidthUpdateCallback(this.curColWidth);
|
||
|
|
+ }
|
||
|
|
this.curRowHeight =
|
||
|
|
((this.curHeight + this.$options.margin) / this.rows) *
|
||
|
|
this.$options.rowHeightRatio;
|
||
|
|
diff --git a/node_modules/angular-gridster2/lib/gridsterConfig.interface.d.ts b/node_modules/angular-gridster2/lib/gridsterConfig.interface.d.ts
|
||
|
|
index 1d7cdf0..a712b35 100644
|
||
|
|
--- a/node_modules/angular-gridster2/lib/gridsterConfig.interface.d.ts
|
||
|
|
+++ b/node_modules/angular-gridster2/lib/gridsterConfig.interface.d.ts
|
||
|
|
@@ -73,6 +73,7 @@ export interface GridsterConfig {
|
||
|
|
useTransformPositioning?: boolean;
|
||
|
|
scrollSensitivity?: number | null;
|
||
|
|
scrollSpeed?: number;
|
||
|
|
+ colWidthUpdateCallback?: (colWidth: number) => number;
|
||
|
|
initCallback?: (gridster: GridsterComponentInterface) => void;
|
||
|
|
destroyCallback?: (gridster: GridsterComponentInterface) => void;
|
||
|
|
gridSizeChangedCallback?: (gridster: GridsterComponentInterface) => void;
|