Skip to content

Commit c551f79

Browse files
committed
basic tile toggle working
1 parent b73ca21 commit c551f79

2 files changed

Lines changed: 56 additions & 16 deletions

File tree

TempMetroReportRestyling/newcss.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,10 @@ h4, h5, h6 {
258258
margin-left: 600px;
259259
}
260260

261+
.filterTileDisabled{
262+
background-color: grey;
263+
}
264+
261265
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section {
262266
display: block;
263267
}

TempMetroReportRestyling/orig.html

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,37 @@ <h3>scenarios</h3>
2929
<h1>5</h1>
3030
</div>
3131
</div>
32-
<div class='tilerow'>
33-
<div class='tile tileNoHover one limebg'>
34-
<h4>PASSED</h4>
35-
<h1>2</h1>
32+
<div class='tilerow' id='filterOptions'>
33+
<div class='tile one limebg' data-target-class="Passed">
34+
<a href="#">
35+
<h4>PASSED</h4>
36+
<h1>2</h1>
37+
</a>
3638
</div>
37-
<div class='tile tileNoHover one redbg'>
38-
<h4>FAILED</h4>
39-
<h1>1</h1>
39+
<div class='tile one redbg' data-target-class="Failed">
40+
<a href="#">
41+
<h4>FAILED</h4>
42+
<h1>1</h1>
43+
</a>
4044
</div>
41-
<div class='tile tileNoHover one orangebg'>
42-
<h4>INCONCLUSIVE</h4>
43-
<h1>1</h1>
45+
<div class='tile one orangebg' data-target-class="Inconclusive">
46+
<a href="#">
47+
<h4>INCONCLUSIVE</h4>
48+
<h1>1</h1>
49+
</a>
4450
</div>
45-
<div class='tile tileNoHover one bluebg'>
46-
<h4>NOT IMPLEMENTED</h4>
47-
<h1>1</h1>
51+
<div class='tile one bluebg' data-target-class="NotImplemented">
52+
<a href="#">
53+
<h4>NOT IMPLEMENTED</h4>
54+
<h1>1</h1>
55+
</a>
4856
</div>
4957
</div>
5058
</div>
5159
</section>
5260
<section id='resultOptions' class='group'>
5361
<h3>options</h3>
54-
<ul id='filterOptions'>
62+
<ul>
5563
<li class='Passed'>
5664
<input id='passedFilter' type='checkbox' checked='' data-target-class='Passed'>
5765
<label for='passedFilter'>passed</label>
@@ -195,8 +203,36 @@ <h3 class='storyTitle'>Story: Using metro style html report example</h3>
195203
</section>
196204
<script type='text/javascript' src='http://code.jquery.com/jquery-2.1.0.min.js'></script>
197205
<script>
198-
$(function(){$(".canToggle").each(function(){var n=$("#"+$(this).data("toggle-target"));n.hide();$(this).click(function(){n.toggle(200)})});$(".expandAll").click(function(){$(".steps").css("display","")});$(".collapseAll").click(function(){$(".steps").css("display","none")});$("ul.resultSummary li:not('.storySummary'):not('.scenarioSummary')").append("<input type='checkbox' class='cbx_toggle' checked/>");$(".cbx_toggle").click(function(){var n=$(this),t=n.closest("li").attr("class");$("#testResult div.scenario ."+t).parent().toggle(n.is(":checked"))})});
199-
/*
206+
$(function () {
207+
$('.canToggle').each(function () {
208+
var target = $('#' + $(this).data('toggle-target'));
209+
target.hide();
210+
$(this).click(function () {
211+
target.toggle(200);
212+
});
213+
});
214+
215+
$('.expandAll').click(function () {
216+
$('.steps').css('display', '');
217+
});
218+
$('.collapseAll').click(function () {
219+
$('.steps').css('display', 'none');
220+
});
221+
222+
223+
$("#filterOptions a").click(function () {
224+
var tile = $(this).parent();
225+
226+
tile.toggleClass("filterTileDisabled");
227+
228+
var show = !tile.hasClass("filterTileDisabled");
229+
230+
var resultType = tile.data("target-class");
231+
232+
$("div.scenario ." + resultType).parent().toggle(show);
233+
});
234+
});
235+
/*
200236
//# sourceMappingURL=classic.min.js.map
201237
*/
202238
</script>

0 commit comments

Comments
 (0)