blob: c7b0ebb6ffb24aebe5b0cd3cdb8a04514f878aeb [file] [log] [blame]
<html>
<head>
<title>op-expando-sk demo</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
<script src="/res/common/js/common.js"></script>
<script src="/res/imp/bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<link rel=import href="/res/imp/bower_components/polymer/polymer.html">
<link rel=import href="op-expando.html">
<link rel="stylesheet" href="/res/common/css/md.css" type="text/css" media="all">
<style type="text/css" media="screen">
#wrapper {
width: 40em;
margin: auto;
}
</style>
</head>
<body>
<h1>Expando Demo</h1>
<div id=wrapper>
<op-expando-sk begin=0 end=5 id=cmds1> </op-expando-sk>
<op-expando-sk begin=5 end=10 id=cmds2> </op-expando-sk>
<op-expando-sk begin=10 end=15 id=cmds3> </op-expando-sk>
<button id="collapse">Collapse</button>
</div>
<script type="text/javascript" charset="utf-8">
var data = {
"version": 1,
"commands": [
{
details: {
command: "BeginDrawPicture",
},
_index: 0,
_depth: 0,
_prefix: [{icon:"image:image", color:"#A6CEE3"}]
},
{
details: {
command: "ClipRect",
shortDesc: " [1.2 1.2 3.4 5.4] ",
},
_index: 0,
_depth: 1,
_prefix:[{icon:"image:image", color:"#A6CEE3"}]
},
]
};
for (var i = 0; i < 100; i++) {
data.commands.push({
details: {
command: "BeginDrawPicture",
},
_index: 2+i,
_depth: 0,
_prefix: [{icon:"image:image", color:"#A6CEE3"}]
}
);
}
$$$('#cmds1').cmd = data;
$$$('#cmds2').cmd = data;
$$$('#cmds3').cmd = data;
$$$('#collapse').addEventListener('click', function() {
$$('op-expando-sk').forEach(function(ele) {
ele.expanded = false;
});
});
</script>
</body>
</html>
<html>