Skip to content

Commit

Permalink
test: test transform
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Jul 10, 2021
1 parent 30538f2 commit 77bd496
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/index.html
Expand Up @@ -29,9 +29,14 @@
border: 1px solid #333;
box-sizing: border-box;
}
.test {
position: relative;
width: 100px;
height: 100px;
}

</style>
<div class="test" contenteditable="true">Test</div>
<div class="test" >Test</div>
<!-- <script src="https://daybrush.com/moveable/release/latest/dist/moveable.js"></script> -->
<script src="../dist/moveable.js"></script>
<script>
Expand All @@ -44,9 +49,10 @@
snapThreshold: 5,
padding: { top: 10 },
}).on("dragStart", e => {
if (e.inputEvent && e.inputEvent.target.className === "test") e.stop();
// if (e.inputEvent && e.inputEvent.target.className === "test") e.stop();
}).on("drag", e => {
e.target.style.cssText = `top: ${e.top}px; left: ${e.left}px;`;
console.log(e.transform);
e.target.style.transform = e.transform;
});

window.addEventListener("keyup", e => {
Expand Down

0 comments on commit 77bd496

Please sign in to comment.