-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(TU-13163): Add duplicate prevention callback example
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
packages/demo-html/public/callbacks-duplicate-prevention.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |