Skip to content

Commit

Permalink
Add "Expand All" and "Collapse All" buttons. (mozilla#356, part 3)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaron committed Jun 5, 2020
1 parent cd75bc1 commit 73d19ba
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ <h1><img src="asset/Mozilla.svg" style="height: 1.04em; vertical-align: -0.23em;

<div class="col-sm-1"></div>
<div class="col-sm-10">

<div>
<a class="btn btn-primary" href="javascript:open_all()">Expand All</a>
<a class="btn btn-primary" href="javascript:close_all()">Collapse All</a>
</div>

<table id="mozPositions" class="table table-hover dataTable">
<thead>
<tr>
Expand Down Expand Up @@ -260,6 +266,12 @@ <h3>legend</h3>
}
}

window.open_all = function() {
ptable.rows().every( function(rowIndex, tableLoop, rowLoop) {
open_row(rowIndex);
});
}

window.open_row = function(row_selector) {
var row = ptable.row(row_selector);
var data = row.data();
Expand All @@ -274,6 +286,12 @@ <h3>legend</h3>
}
}

window.close_all = function() {
ptable.rows().every( function(rowIndex, tableLoop, rowLoop) {
close_row(rowIndex);
});
}

window.close_row = function(row_selector) {
var row = ptable.row(row_selector);
var data = row.data();
Expand Down

0 comments on commit 73d19ba

Please sign in to comment.