Skip to content

Commit d5e1aca

Browse files
SpencerAWillxFrednet
authored andcommitted
Add Expand All and Collapse All
1 parent b794b8e commit d5e1aca

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

util/gh-pages/index.html

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,17 @@
5757
background-color: var(--theme-hover);
5858
}
5959

60-
div.panel div.panel-body button.dropdown-toggle {
60+
div.panel div.panel-body button {
6161
background: var(--searchbar-bg);
6262
color: var(--searchbar-fg);
6363
border-color: var(--theme-popup-border);
6464
}
6565

66-
div.panel div.panel-body button.dropdown-toggle:hover {
66+
div.panel div.panel-body button:hover {
6767
box-shadow: 0 0 3px var(--searchbar-shadow-color);
6868
}
6969

70-
div.panel div.panel-body .open button.dropdown-toggle {
71-
background: var(--searchbar-bg);
72-
color: var(--searchbar-fg);
73-
border-color: var(--theme-popup-border);
70+
div.panel div.panel-body button.open {
7471
filter: brightness(90%);
7572
}
7673

@@ -96,7 +93,6 @@
9693
@media (min-width: 992px) {
9794
.search-control {
9895
margin-top: 0;
99-
float: right;
10096
}
10197
}
10298

@@ -537,6 +533,14 @@ <h1>Clippy Lints</h1>
537533
</span>
538534
</div>
539535
</div>
536+
<div class="btn-group">
537+
<button title="Collapse All" class="btn btn-default expansion-control" type="button" ng-click="toggleExpansion(data, false); $event.stopPropagation()">
538+
<span class="glyphicon glyphicon-collapse-up"></span>
539+
</button>
540+
<button title="Expand All" class="btn btn-default expansion-control" type="button" ng-click="toggleExpansion(data, true); $event.stopPropagation()">
541+
<span class="glyphicon glyphicon-collapse-down"></span>
542+
</button>
543+
</div>
540544
</div>
541545
</div>
542546
<!-- The order of the filters should be from most likely to remove a lint to least likely to improve performance. -->

util/gh-pages/script.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,12 @@
469469
$location.path(lint.id);
470470
};
471471

472+
$scope.toggleExpansion = function(lints, isExpanded) {
473+
lints.forEach(lint => {
474+
$scope.open[lint.id] = isExpanded;
475+
});
476+
}
477+
472478
$scope.copyToClipboard = function (lint) {
473479
const clipboard = document.getElementById("clipboard-" + lint.id);
474480
if (clipboard) {

0 commit comments

Comments
 (0)