6 changed files with 22 additions and 60 deletions
@ -1,44 +1,15 @@ |
|||
diff --git a/node_modules/angular-gridster2/fesm2020/angular-gridster2.mjs b/node_modules/angular-gridster2/fesm2020/angular-gridster2.mjs
|
|||
index cf4e220..4275d11 100644
|
|||
index cf4e220..df51c91 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 {
|
|||
@@ -666,8 +666,8 @@ class GridsterRenderer {
|
|||
renderer.setStyle(el, DirTypes.LTR ? 'margin-right' : 'margin-left', ''); |
|||
} |
|||
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; |
|||
- const x = Math.round(this.gridster.curColWidth * item.x);
|
|||
- const y = Math.round(this.gridster.curRowHeight * item.y);
|
|||
+ const x = this.gridster.curColWidth * item.x;
|
|||
+ const y = this.gridster.curRowHeight * item.y;
|
|||
const width = this.gridster.curColWidth * item.cols - this.gridster.$options.margin; |
|||
const height = this.gridster.curRowHeight * item.rows - this.gridster.$options.margin; |
|||
// set the cell style |
|||
|
|||
Loading…
Reference in new issue