/
fb-modal.html
43 lines (39 loc) · 919 Bytes
/
fb-modal.html
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
41
42
43
<div class="modal" id="modal"></div>
<script class="modal" type="text/x-jquery-tmpl">
<div class="modalContainer">
<h1>${title}</h1>
<div class="modalContent">
{{html body}}
</div>
<div class="modalFooter">
{{if (footer instanceof Array)}}
{{each footer}}
<a href="${href}"
{{each $value}}
${$index}="${$value}"
{{/each}}
>${content}</a>
{{/each}}
{{else}}
{{html footer}}
{{/if}}
</div>
</div>
</script>
<!-- EXAMPLE --
jv.UTIL.tmpl("modal", {
title: "awesome",
body: "<p>You win!</p>",
-- OR --
body: $('#someModalContentDiv').html(),
-- OR --
body: $('#someTemplate').tmpl(data).html(),
footer: '<a href="#">Home</a><a href="#">Back to Job</a>'
-- OR --
footer: [
{ href: "http://somepath.com", content: "Visit SomePath", otherAttribute: "whatever" },
{ href: "home.htm", content: "Go Back?", class: "whatever" }
]
}).fadeIn();
window.location = "#modal";
-->