forked from OfficeDev/Microsoft-Teams-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_EmbedPage.cshtml
40 lines (37 loc) · 1.07 KB
/
_EmbedPage.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
@Scripts.Render("https://unpkg.com/@microsoft/teams-js@1.3.4/dist/MicrosoftTeams.min.js")
@RenderSection("scripts", required: false)
</head>
<body>
<style>
body {
margin: 0;
}
#embed-container iframe {
position: absolute;
top: 0;
left: 0;
width: 95%;
height: 95%;
padding-left: 20px;
padding-right: 20px;
padding-top: 10px;
padding-bottom: 10px;
border-style: none;
}
</style>
<script>
microsoftTeams.initialize();
//- Handle the Esc key
document.onkeyup = function (event) {
if ((event.key === 27) || (event.key === "Escape")) {
microsoftTeams.tasks.submitTask(null); //- this will return an err object to the completionHandler()
}
}</script>
<div id="embed-container">@RenderBody()</div>
</body>
</html>