forked from jupiterjs/srchr
/
tabs.html
45 lines (40 loc) · 1000 Bytes
/
tabs.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
44
45
<!DOCTYPE html>
<html lang="en">
<head>
<title>srchr.tabs</title>
<style>
.tab { border: solid 1px black; }
ul.tabs { margin-bottom: 10px; }
</style>
</head>
<body>
<div id="demo-html">
<ul id="resultsTab">
<li><a href="#flickr">Flickr</a></li>
<li><a href="#yahoo">Yahoo</a></li>
<li><a href="#upcoming">Upcoming</a></li>
</ul>
<div id="flickr" class="tab">Flickr Stuff</div>
<div id="yahoo" class="tab">Yahoo Stuff</div>
<div id="upcoming" class="tab">Upcoming Stuff</div>
<button id="enable">Enable flickr and upcoming</button>
</div>
<script>
DEMO_HTML = document.getElementById("demo-html").innerHTML
</script>
<script type="text/javascript"
src="../../bower_components/steal/steal.js">
</script>
<script type="text/javascript" id="demo-source">
steal("ui/tabs", function(Tabs){
var enabled = can.compute(["flickr","yahoo"])
new Tabs("#resultsTab",{
enabled: enabled
});
$("#enable").click(function(){
enabled(["flickr","upcoming"])
})
})
</script>
</body>
</html>