@cocreate/resize 1.1.73 → 1.1.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.1.74](https://github.com/CoCreate-app/CoCreate-resize/compare/v1.1.73...v1.1.74) (2022-06-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * if detectGrid has no parent element return ([cb0a6fd](https://github.com/CoCreate-app/CoCreate-resize/commit/cb0a6fd7f9b45fdc66879ff6e2737d5363321eb3))
7
+
1
8
  ## [1.1.73](https://github.com/CoCreate-app/CoCreate-resize/compare/v1.1.72...v1.1.73) (2022-06-07)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/resize",
3
- "version": "1.1.73",
3
+ "version": "1.1.74",
4
4
  "description": "A light weight resize handler make any element resizable by adding data attributes or usinng init object. Great for Customized text box or text area.",
5
5
  "keywords": [
6
6
  "resize",
package/src/index.js CHANGED
@@ -280,10 +280,13 @@ CoCreateResize.prototype = {
280
280
  },
281
281
 
282
282
  detectGrid: function() {
283
- let compStyles = window.getComputedStyle(this.resizeWidget.parentNode);
284
- let isGrid = (compStyles.display === 'grid') ? true : false;
283
+ let isGrid = false;
284
+ if (this.resizeWidget.parentNode) {
285
+ let compStyles = window.getComputedStyle(this.resizeWidget.parentNode);
286
+ isGrid = (compStyles.display === 'grid');
287
+ }
285
288
  this.isGrid = isGrid;
286
- return isGrid
289
+ return isGrid;
287
290
  },
288
291
 
289
292
  stopDrag: function(e) {
@@ -339,7 +342,6 @@ CoCreateResize.prototype = {
339
342
  this.initDrags['left'] = this.initLeftDrag.bind(this);
340
343
  this.initDrags['bottom'] = this.initBottomDrag.bind(this);
341
344
  this.initDrags['right'] = this.initRightDrag.bind(this);
342
-
343
345
  },
344
346
 
345
347
  getDistance: function(elem, flag) {