@cocreate/resize 1.1.72 → 1.1.75

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,26 @@
1
+ ## [1.1.75](https://github.com/CoCreate-app/CoCreate-resize/compare/v1.1.74...v1.1.75) (2022-06-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update dependencies ([ec46092](https://github.com/CoCreate-app/CoCreate-resize/commit/ec460926168a1eda3ce16048746af2686d88e105))
7
+ * update docs css document_id ([173bda0](https://github.com/CoCreate-app/CoCreate-resize/commit/173bda0d16d435624093dc845bf246b2ed22be40))
8
+ * update modal btn to actions ([b8b5acc](https://github.com/CoCreate-app/CoCreate-resize/commit/b8b5acc1e27a1b41238f9fc9fe4bafa400413da0))
9
+
10
+ ## [1.1.74](https://github.com/CoCreate-app/CoCreate-resize/compare/v1.1.73...v1.1.74) (2022-06-08)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * if detectGrid has no parent element return ([cb0a6fd](https://github.com/CoCreate-app/CoCreate-resize/commit/cb0a6fd7f9b45fdc66879ff6e2737d5363321eb3))
16
+
17
+ ## [1.1.73](https://github.com/CoCreate-app/CoCreate-resize/compare/v1.1.72...v1.1.73) (2022-06-07)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * left postion missing px when adding style ([b1019b7](https://github.com/CoCreate-app/CoCreate-resize/commit/b1019b7bd32c47c2537031ea284f69cb73442ea9))
23
+
1
24
  ## [1.1.72](https://github.com/CoCreate-app/CoCreate-resize/compare/v1.1.71...v1.1.72) (2022-05-23)
2
25
 
3
26
 
@@ -56,9 +56,9 @@
56
56
  <ul class="display:inline-flex direction:rtl overflow:auto font-size:20px align-items:center list-style-type:none width:100% height:50px">
57
57
 
58
58
  <!-- Modal Controls -->
59
- <li class="margin-right:15px"><a class="btn-modal-close"><i class="fas fa-times"></i></a></li>
60
- <li class="margin-right:15px"><a class="btn-modal-maximize"><i toggle="fa-window-restore, fa-window-maximize" class="far fa-window-maximize"></i></a></li>
61
- <li class="margin-right:15px"><a class="btn-modal-minimize"><i class="far fa-window-minimize"></i></a></li>
59
+ <li class="margin-right:15px"><a actions="closeModal"><i class="fas fa-times"></i></a></li>
60
+ <li class="margin-right:15px"><a actions="minMaxModal"><i toggle="fa-window-restore, fa-window-maximize" class="far fa-window-maximize"></i></a></li>
61
+ <li class="margin-right:15px"><a actions="parkModal"><i class="far fa-window-minimize"></i></a></li>
62
62
 
63
63
  <!-- fullscreen toogle and icon transform-->
64
64
  <li class="margin-right:15px"><a fullscreen><i toggle="fa-compress, fa-expand" class="fas fa-expand"></i></a></li>
@@ -90,7 +90,7 @@
90
90
 
91
91
  <!-- deleteDocument-->
92
92
  <li class="margin-right:15px">
93
- <a actions="deleteDocument" collection="" document_id="" pass_id="form-fields" class="btn-modal-close">
93
+ <a actions="deleteDocument, closeModal" collection="" document_id="" pass_id="form-fields">
94
94
  <i class="far fa-trash-alt"></i>
95
95
  </a>
96
96
  </li>
package/docs/index.html CHANGED
@@ -12,7 +12,7 @@
12
12
  <meta name="robots" content="index,follow" />
13
13
  <meta property="og:image" content="https://cdn.cocreate.app/docs/resize.png">
14
14
 
15
- <link rel="stylesheet" href="/docs/index.css" collection="files" document_id="62827d7e8082ce05b081430b" name="src" type="text/css" save="true" />
15
+ <link rel="stylesheet" href="/docs/index.css" collection="files" document_id="60888216117c640e7596303f" name="src" type="text/css" save="true" />
16
16
  </head>
17
17
 
18
18
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/resize",
3
- "version": "1.1.72",
3
+ "version": "1.1.75",
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",
@@ -60,7 +60,7 @@
60
60
  "webpack-log": "^3.0.1"
61
61
  },
62
62
  "dependencies": {
63
- "@cocreate/docs": "^1.3.1",
64
- "@cocreate/observer": "^1.5.1"
63
+ "@cocreate/docs": "^1.3.2",
64
+ "@cocreate/observer": "^1.5.2"
65
65
  }
66
66
  }
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);
@@ -277,8 +280,13 @@ CoCreateResize.prototype = {
277
280
  },
278
281
 
279
282
  detectGrid: function() {
280
- let compStyles = window.getComputedStyle(this.resizeWidget.parentNode);
281
- return (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
+ }
288
+ this.isGrid = isGrid;
289
+ return isGrid;
282
290
  },
283
291
 
284
292
  stopDrag: function(e) {
@@ -334,7 +342,6 @@ CoCreateResize.prototype = {
334
342
  this.initDrags['left'] = this.initLeftDrag.bind(this);
335
343
  this.initDrags['bottom'] = this.initBottomDrag.bind(this);
336
344
  this.initDrags['right'] = this.initRightDrag.bind(this);
337
-
338
345
  },
339
346
 
340
347
  getDistance: function(elem, flag) {