@cocreate/resize 1.1.72 → 1.1.73

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.73](https://github.com/CoCreate-app/CoCreate-resize/compare/v1.1.72...v1.1.73) (2022-06-07)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * left postion missing px when adding style ([b1019b7](https://github.com/CoCreate-app/CoCreate-resize/commit/b1019b7bd32c47c2537031ea284f69cb73442ea9))
7
+
1
8
  ## [1.1.72](https://github.com/CoCreate-app/CoCreate-resize/compare/v1.1.71...v1.1.72) (2022-05-23)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/resize",
3
- "version": "1.1.72",
3
+ "version": "1.1.73",
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
@@ -49,6 +49,7 @@ CoCreateResize.prototype = {
49
49
  this.Drags = [];
50
50
 
51
51
  //this is for grid
52
+ this.isGrid = this.detectGrid();
52
53
  this.gridWidth = 0;
53
54
  this.gridHeight = 0;
54
55
  // this.missingWidth = 0;
@@ -246,14 +247,16 @@ CoCreateResize.prototype = {
246
247
  if (e.touches)
247
248
  e = e.touches[0];
248
249
  left = this.startLeft + e.clientX - this.startX;
250
+ console.log('left', left)
249
251
  width = this.startWidth - e.clientX + this.startX;
250
252
 
251
253
  if (width < 10)
252
254
  return;
253
- // this.resizeWidget.style.left = left + 'px';
254
- let compStyles = window.getComputedStyle(this.resizeWidget);
255
- this.resizeWidget.style.right = compStyles.right;
256
- this.resizeWidget.style.left = null;
255
+ if (!this.isGrid)
256
+ this.resizeWidget.style.left = left + 'px';
257
+ // let compStyles = window.getComputedStyle(this.resizeWidget);
258
+ // this.resizeWidget.style.right = compStyles.right;
259
+ // this.resizeWidget.style.left = null;
257
260
  this.resizeWidget.style.width = width + 'px';
258
261
 
259
262
  this.setColumnEnd(width);
@@ -278,7 +281,9 @@ CoCreateResize.prototype = {
278
281
 
279
282
  detectGrid: function() {
280
283
  let compStyles = window.getComputedStyle(this.resizeWidget.parentNode);
281
- return (compStyles.display === 'grid') ? true : false;
284
+ let isGrid = (compStyles.display === 'grid') ? true : false;
285
+ this.isGrid = isGrid;
286
+ return isGrid
282
287
  },
283
288
 
284
289
  stopDrag: function(e) {