New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vuetify-multiple-draggable-dialogs

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vuetify-multiple-draggable-dialogs - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "vuetify-multiple-draggable-dialogs",
"version": "1.0.2",
"version": "1.0.3",
"description": "Extension that gives ability to have multiple active draggable dialogs",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -1,74 +0,78 @@

export default {
methods: {
multipleDraggableDialogs() {
(function () { // make vuetify dialogs movable
const d = {};
document.addEventListener("mousedown", e => {
const closestDialog = e.target.closest(".v-dialog.v-dialog--active");
module.exports = function () {
(function () { // make vuetify dialogs movable
const d = {};
document.addEventListener("mousedown", e => {
const closestDialog = e.target.closest(".v-dialog.v-dialog--active");
const content = e.target.closest('.v-dialog__content.v-dialog__content--active');
const elements = document.querySelectorAll(".v-dialog__content.v-dialog__content--active");
const main = e.target.closest(".v-dialog__content.v-dialog__content--active");
let indexes = [];
const content = e.target.closest('.v-dialog__content.v-dialog__content--active');
const elements = document.querySelectorAll(".v-dialog__content.v-dialog__content--active");
const main = e.target.closest(".v-dialog__content.v-dialog__content--active");
let indexes = [];
elements.forEach((el) => {
indexes.push(parseInt(el.style.zIndex));
});
elements.forEach((el) => {
indexes.push(parseInt(el.style.zIndex));
});
const maxIndex = Math.max(...indexes);
const currentIndex = parseInt(main.style.zIndex);
const maxIndex = Math.max(...indexes);
const currentIndex = parseInt(main.style.zIndex);
if (currentIndex < maxIndex) {
elements.forEach((el) => {
if (parseInt(el.style.zIndex) === maxIndex) {
el.style.zIndex = currentIndex;
main.style.zIndex = maxIndex;
}
});
if (currentIndex < maxIndex) {
elements.forEach((el) => {
if (parseInt(el.style.zIndex) === maxIndex) {
el.style.zIndex = currentIndex;
main.style.zIndex = maxIndex;
}
});
}
// for (let i in elements.entries()) {
// let zIndex = parseInt(elements[i].styles);
// console.log(elements[i].styles);
// }
// for (let i in elements.entries()) {
// let zIndex = parseInt(elements[i].styles);
// console.log(elements[i].styles);
// }
if (e.button === 0 && closestDialog != null && e.target.classList.contains("v-card__title")) { // element which can be used to move element
d.el = closestDialog; // element which should be moved
d.mouseStartX = e.clientX;
d.mouseStartY = e.clientY;
d.elStartX = d.el.getBoundingClientRect().left;
d.elStartY = d.el.getBoundingClientRect().top;
d.el.style.position = "fixed";
d.el.style.margin = 0;
d.oldTransition = d.el.style.transition;
d.el.style.transition = "none"
// d.el.style.zIndex = 1000;
}
});
document.addEventListener("mousemove", e => {
if (d.el === undefined) return;
d.el.style.left = Math.min(
Math.max(d.elStartX + e.clientX - d.mouseStartX, 0),
window.innerWidth - d.el.getBoundingClientRect().width
) + "px";
d.el.style.top = Math.min(
Math.max(d.elStartY + e.clientY - d.mouseStartY, 0),
window.innerHeight - d.el.getBoundingClientRect().height
) + "px";
});
document.addEventListener("mouseup", () => {
if (d.el === undefined) return;
d.el.style.transition = d.oldTransition;
d.el = undefined
});
setInterval(() => { // prevent out of bounds
const dialog = document.querySelector(".v-dialog.v-dialog--active");
if (dialog === null) return;
dialog.style.left = Math.min(parseInt(dialog.style.left), window.innerWidth - dialog.getBoundingClientRect().width) + "px";
dialog.style.top = Math.min(parseInt(dialog.style.top), window.innerHeight - dialog.getBoundingClientRect().height) + "px";
}, 100);
})();
}
},
if (e.button === 0 && closestDialog != null && e.target.classList.contains("v-card__title")) { // element which can be used to move element
d.el = closestDialog; // element which should be moved
d.mouseStartX = e.clientX;
d.mouseStartY = e.clientY;
d.elStartX = d.el.getBoundingClientRect().left;
d.elStartY = d.el.getBoundingClientRect().top;
d.el.style.position = "fixed";
d.el.style.margin = 0;
d.oldTransition = d.el.style.transition;
d.el.style.transition = "none"
// d.el.style.zIndex = 1000;
}
});
document.addEventListener("mousemove", e => {
if (d.el === undefined) return;
d.el.style.left = Math.min(
Math.max(d.elStartX + e.clientX - d.mouseStartX, 0),
window.innerWidth - d.el.getBoundingClientRect().width
) + "px";
d.el.style.top = Math.min(
Math.max(d.elStartY + e.clientY - d.mouseStartY, 0),
window.innerHeight - d.el.getBoundingClientRect().height
) + "px";
});
document.addEventListener("mouseup", () => {
if (d.el === undefined) return;
d.el.style.transition = d.oldTransition;
d.el = undefined
});
setInterval(() => { // prevent out of bounds
const dialog = document.querySelector(".v-dialog.v-dialog--active");
if (dialog === null) return;
dialog.style.left = Math.min(parseInt(dialog.style.left), window.innerWidth - dialog.getBoundingClientRect().width) + "px";
dialog.style.top = Math.min(parseInt(dialog.style.top), window.innerHeight - dialog.getBoundingClientRect().height) + "px";
}, 100);
})();
};
// export default {
// methods: {
// multipleDraggableDialogs() {
//
// }
// },
// };
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc