Skip to content

Commit

Permalink
feat(TU-13163): Add duplicate prevention callback example
Browse files Browse the repository at this point in the history
  • Loading branch information
gierlas committed Aug 26, 2024
1 parent d91c76c commit 7b0272e
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions packages/demo-html/public/callbacks-duplicate-prevention.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Static HTML Demo</title>
<style>
#wrapper {
width: 100%;
max-width: 600px;
height: 400px;
margin: 0 auto;
}
.element {
position: fixed;
bottom: 0;
right: 0;
background: red;
color: white;
padding: 10px;
width: 200px;
height: 60px;
line-height: 40px;
z-index: 10000;
}
</style>
<link rel="stylesheet" href="./lib/css/widget.css" />
</head>
<body>
<div class="element">I have z-index 10k</div>
<div id="wrapper"></div>
<script src="./lib/embed.js"></script>
<script>
window.tf.createWidget('pfnUIIso', {
container: document.getElementById('wrapper'),
onDuplicateDetected: ({formId}) => {
console.log(`Form ${formId} is already answered`)
},
})
</script>
</body>
</html>

0 comments on commit 7b0272e

Please sign in to comment.