Skip to content

Commit

Permalink
Update DragCard.js
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackCube4 authored Feb 14, 2024
1 parent b42222c commit 5a43671
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions DragCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ class DragCard extends HTMLElement {
this.distanceMouse = 0;
this.clickCount = 0;

/*
this.maxDrag = 100; //the maximum distance the button can be dragged in px
this.stopSpeedFactor = 1; //the speed at which the button will reach its max drag distance
this.repeatTime = 200; //rapid fire interval time in ms
this.holdTime = 800; //time until hold action gets activated in ms
this.maxMultiClicks = 2; //max amount of MultiClicks to register
this.deadzone = 30; //distance in px until click action will be triggert
*/
this.multiClickTime = 300; //time between clicks to activate multi click in ms

this.lastClick = null; //value to store the last click time
this.lastClickType = null;
}
Expand Down Expand Up @@ -116,6 +106,7 @@ class DragCard extends HTMLElement {
if (this.repeatTime == null) {this.repeatTime = 200}
if (this.holdTime == null) {this.holdTime = 800}
if (this.maxMultiClicks == null) {this.maxMultiClicks = 2}
if (this.multiClickTime == null) {this.multiClickTime = 300}
if (this.deadzone == null) {this.deadzone = 20}

this.stopSpeed = this.maxDrag * this.stopSpeedFactor;
Expand Down Expand Up @@ -454,14 +445,15 @@ class DragCard extends HTMLElement {
this.icoTriple = config.icoTriple;
this.icoQuadruple = config.icoQuadruple;
this.icoFivefold = config.icoFivefold;
this.icoSixfold = config.entitySixfold;
this.icoSixfold = config.iconSixfold;

this.maxDrag = config.maxDrag; //the maximum distance the button can be dragged in px
this.stopSpeedFactor = config.stopSpeedFactor; //the speed at which the button will reach its max drag distance
this.repeatTime = config.repeatTime; //rapid fire interval time in ms
this.holdTime = config.holdTime; //time until hold action gets activated in ms
this.maxMultiClicks = config.maxMultiClicks; //max amount of MultiClicks to register
this.deadzone = config.deadzone;
this.multiClickTime = config.multiClickTime; //time between clicks to activate multi click in ms
this.deadzone = config.deadzone;

this.isStandalone = config.isStandalone;
this.padding = config.padding;
Expand Down

0 comments on commit 5a43671

Please sign in to comment.