@cocreate/resize 1.1.70 → 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 +21 -0
- package/docs/index.html +1 -1
- package/package.json +3 -3
- package/src/index.js +10 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
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
|
+
|
|
8
|
+
## [1.1.72](https://github.com/CoCreate-app/CoCreate-resize/compare/v1.1.71...v1.1.72) (2022-05-23)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* bump all dependencies ([c99fb25](https://github.com/CoCreate-app/CoCreate-resize/commit/c99fb2506f276e79b2c3c126b8616838965671cd))
|
|
14
|
+
|
|
15
|
+
## [1.1.71](https://github.com/CoCreate-app/CoCreate-resize/compare/v1.1.70...v1.1.71) (2022-05-19)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* update document_id on link index.css ([ae7f40b](https://github.com/CoCreate-app/CoCreate-resize/commit/ae7f40b5a1eab689ebb4b8535dd47b94de1ff17a))
|
|
21
|
+
|
|
1
22
|
## [1.1.70](https://github.com/CoCreate-app/CoCreate-resize/compare/v1.1.69...v1.1.70) (2022-05-06)
|
|
2
23
|
|
|
3
24
|
|
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="
|
|
15
|
+
<link rel="stylesheet" href="/docs/index.css" collection="files" document_id="62827d7e8082ce05b081430b" 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.
|
|
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",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"webpack-log": "^3.0.1"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@cocreate/docs": "^1.
|
|
64
|
-
"@cocreate/observer": "^1.
|
|
63
|
+
"@cocreate/docs": "^1.3.1",
|
|
64
|
+
"@cocreate/observer": "^1.5.1"
|
|
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
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
this.resizeWidget.style.
|
|
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
|
-
|
|
284
|
+
let isGrid = (compStyles.display === 'grid') ? true : false;
|
|
285
|
+
this.isGrid = isGrid;
|
|
286
|
+
return isGrid
|
|
282
287
|
},
|
|
283
288
|
|
|
284
289
|
stopDrag: function(e) {
|