@cocreate/position 1.1.30 → 1.1.32

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,18 @@
1
+ ## [1.1.32](https://github.com/CoCreate-app/CoCreate-position/compare/v1.1.31...v1.1.32) (2022-12-29)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * bump dependencies ([d61b374](https://github.com/CoCreate-app/CoCreate-position/commit/d61b374d0bae0e5df50d211951bfd047e514f8de))
7
+
8
+ ## [1.1.31](https://github.com/CoCreate-app/CoCreate-position/compare/v1.1.30...v1.1.31) (2022-12-27)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * bump dependencies ([62bc69b](https://github.com/CoCreate-app/CoCreate-position/commit/62bc69b73b8ce36b3345f41f81e906595d71823d))
14
+ * removed param this.isHeader ([24d5439](https://github.com/CoCreate-app/CoCreate-position/commit/24d5439778ec9f727b3d5f8266733a044b5befb4))
15
+
1
16
  ## [1.1.30](https://github.com/CoCreate-app/CoCreate-position/compare/v1.1.29...v1.1.30) (2022-12-25)
2
17
 
3
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/position",
3
- "version": "1.1.30",
3
+ "version": "1.1.32",
4
4
  "description": "Make any element draggable and movable. Customizable via attributes, great for popups, alerts, multitasking and displaying multiple views.",
5
5
  "keywords": [
6
6
  "position",
@@ -60,7 +60,7 @@
60
60
  "webpack-log": "^3.0.1"
61
61
  },
62
62
  "dependencies": {
63
- "@cocreate/docs": "^1.4.25",
64
- "@cocreate/observer": "^1.5.47"
63
+ "@cocreate/docs": "^1.4.27",
64
+ "@cocreate/observer": "^1.5.49"
65
65
  }
66
66
  }
package/src/position.js CHANGED
@@ -31,7 +31,6 @@ function position(el, container, options) {
31
31
  this.clickedInfo = null;
32
32
  this.preSnapped = null;
33
33
  this.isSnap = false;
34
- this.isHeader = true;
35
34
 
36
35
  this._createGhost(this.container.getAttribute("data-ghost-class"));
37
36
  this._initEvent();
@@ -136,7 +135,7 @@ position.prototype = {
136
135
  this.isSnap = true;
137
136
  }
138
137
 
139
- var ghost_info = {
138
+ let ghost_info = {
140
139
  x: this.rect.x,
141
140
  y: this.rect.y,
142
141
  w: this.rect.width,
@@ -205,7 +204,7 @@ position.prototype = {
205
204
  __animate: function () {
206
205
  let c_info = this.clickedInfo;
207
206
 
208
- var eventName = null;
207
+ let eventName = null;
209
208
 
210
209
  if (c_info && c_info.isMoving) {
211
210
  /**
@@ -273,10 +272,7 @@ position.prototype = {
273
272
  },
274
273
 
275
274
  _isMovable() {
276
- var width = this.rect.width;
277
- // if (this.isHeader) {
278
- // width -= 120;
279
- // }
275
+ let width = this.rect.width;
280
276
  return this.point.x > 0 && this.point.x < width && this.point.y > 0 && this.point.y < this.dragAreaHeight;
281
277
  },
282
278
 
@@ -285,12 +281,12 @@ position.prototype = {
285
281
  * move: element-moving, element-moveend, element-movestart
286
282
  **/
287
283
  createEvent(eventName) {
288
- var event = new CustomEvent(eventName, { detail: { element: this.el, instance: this } });
284
+ const event = new CustomEvent(eventName, { detail: { element: this.el, instance: this } });
289
285
  this.el.dispatchEvent(event);
290
286
  },
291
287
 
292
288
  _createGhost: function (ghostClass) {
293
- var node = document.createElement("div");
289
+ let node = document.createElement("div");
294
290
  if (!ghostClass) {
295
291
  ghostClass = "snap-ghost";
296
292
  }