Skip to content

Commit

Permalink
Use .hidden/.show for showing/hiding the reset buttons
Browse files Browse the repository at this point in the history
Signed-off-by: XhmikosR <[email protected]>
  • Loading branch information
XhmikosR committed May 23, 2020
1 parent 821b283 commit e70e108
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 28 deletions.
2 changes: 1 addition & 1 deletion dns_records.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
</tr>
</thead>
</table>
<button type="button" id="resetButton" hidden="true" class="btn btn-default btn-sm text-red">Clear Filters</button>
<button type="button" id="resetButton" class="btn btn-default btn-sm text-red hidden">Clear Filters</button>
</div>
<!-- /.box-body -->
</div>
Expand Down
2 changes: 1 addition & 1 deletion groups-adlists.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</tr>
</thead>
</table>
<button type="button" id="resetButton" hidden="true" class="btn btn-default btn-sm text-red">Reset sorting</button>
<button type="button" id="resetButton" class="btn btn-default btn-sm text-red hidden">Reset sorting</button>
</div>
<!-- /.box-body -->
</div>
Expand Down
2 changes: 1 addition & 1 deletion groups-clients.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</tr>
</thead>
</table>
<button type="button" id="resetButton" hidden="true" class="btn btn-default btn-sm text-red">Reset sorting</button>
<button type="button" id="resetButton" class="btn btn-default btn-sm text-red hidden">Reset sorting</button>
</div>
<!-- /.box-body -->
</div>
Expand Down
2 changes: 1 addition & 1 deletion groups-domains.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
</tr>
</thead>
</table>
<button type="button" id="resetButton" hidden="true" class="btn btn-default btn-sm text-red">Reset sorting</button>
<button type="button" id="resetButton" class="btn btn-default btn-sm text-red hidden">Reset sorting</button>
</div>
<!-- /.box-body -->
</div>
Expand Down
2 changes: 1 addition & 1 deletion groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
</tr>
</thead>
</table>
<button type="button" id="resetButton" hidden="true" class="btn btn-default btn-sm text-red">Reset sorting</button>
<button type="button" id="resetButton" class="btn btn-default btn-sm text-red hidden">Reset sorting</button>
</div>
<!-- /.box-body -->
</div>
Expand Down
2 changes: 1 addition & 1 deletion queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
</tfoot>
</table>
<label><input type="checkbox" id="autofilter">&nbsp;Apply filtering on click on Type, Domain, and Clients</label><br/>
<button type="button" id="resetButton" hidden="true" class="btn btn-default btn-sm text-red">Clear Filters</button>
<button type="button" id="resetButton" class="btn btn-default btn-sm text-red hidden">Clear Filters</button>
</div>
<!-- /.box-body -->
</div>
Expand Down
2 changes: 1 addition & 1 deletion scripts/pi-hole/js/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function checkMessages() {

$("#pihole-diagnosis").prop("title", title);
$("#pihole-diagnosis-count").text(data.message_count);
$("#pihole-diagnosis").removeClass("d-none");
$("#pihole-diagnosis").removeClass("hidden");
}
});
}
Expand Down
6 changes: 3 additions & 3 deletions scripts/pi-hole/js/groups-adlists.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,14 @@ function initTable() {
table.on("order.dt", function () {
var order = table.order();
if (order[0][0] !== 0 || order[0][1] !== "asc") {
$("#resetButton").show();
$("#resetButton").removeClass("hidden");
} else {
$("#resetButton").hide();
$("#resetButton").addClass("hidden");
}
});
$("#resetButton").on("click", function () {
table.order([[0, "asc"]]).draw();
$("#resetButton").hide();
$("#resetButton").addClass("hidden");
});

// Disable autocorrect in the search box
Expand Down
6 changes: 3 additions & 3 deletions scripts/pi-hole/js/groups-clients.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,14 @@ function initTable() {
table.on("order.dt", function () {
var order = table.order();
if (order[0][0] !== 0 || order[0][1] !== "asc") {
$("#resetButton").show();
$("#resetButton").removeClass("hidden");
} else {
$("#resetButton").hide();
$("#resetButton").addClass("hidden");
}
});
$("#resetButton").on("click", function () {
table.order([[0, "asc"]]).draw();
$("#resetButton").hide();
$("#resetButton").addClass("hidden");
});
}

Expand Down
6 changes: 3 additions & 3 deletions scripts/pi-hole/js/groups-domains.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,14 @@ function initTable() {
table.on("order.dt", function () {
var order = table.order();
if (order[0][0] !== 0 || order[0][1] !== "asc") {
$("#resetButton").show();
$("#resetButton").removeClass("hidden");
} else {
$("#resetButton").hide();
$("#resetButton").addClass("hidden");
}
});
$("#resetButton").on("click", function () {
table.order([[0, "asc"]]).draw();
$("#resetButton").hide();
$("#resetButton").addClass("hidden");
});
}

Expand Down
6 changes: 3 additions & 3 deletions scripts/pi-hole/js/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ $(document).ready(function () {
table.on("order.dt", function () {
var order = table.order();
if (order[0][0] !== 0 || order[0][1] !== "asc") {
$("#resetButton").show();
$("#resetButton").removeClass("hidden");
} else {
$("#resetButton").hide();
$("#resetButton").addClass("hidden");
}
});
$("#resetButton").on("click", function () {
table.order([[0, "asc"]]).draw();
$("#resetButton").hide();
$("#resetButton").addClass("hidden");
});
});

Expand Down
8 changes: 4 additions & 4 deletions scripts/pi-hole/js/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ $(document).ready(function () {
api.$("td:eq(1)").click(function () {
if (autofilter()) {
api.search(this.textContent).draw();
$("#resetButton").show();
$("#resetButton").removeClass("hidden");
}
});
api.$("td:eq(1)").hover(
Expand All @@ -454,7 +454,7 @@ $(document).ready(function () {
if (autofilter()) {
var domain = this.textContent.split("\n")[0];
api.search(domain).draw();
$("#resetButton").show();
$("#resetButton").removeClass("hidden");
}
});
api.$("td:eq(2)").hover(
Expand All @@ -477,7 +477,7 @@ $(document).ready(function () {
api.$("td:eq(3)").click(function () {
if (autofilter()) {
api.search(this.textContent).draw();
$("#resetButton").show();
$("#resetButton").removeClass("hidden");
}
});
api.$("td:eq(3)").hover(
Expand Down Expand Up @@ -509,7 +509,7 @@ $(document).ready(function () {

$("#resetButton").click(function () {
tableApi.search("").draw();
$("#resetButton").hide();
$("#resetButton").addClass("hidden");
});

// Disable autocorrect in the search box
Expand Down
2 changes: 1 addition & 1 deletion scripts/pi-hole/php/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ function pidofFTL()
</a>
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li id="pihole-diagnosis" class="d-none">
<li id="pihole-diagnosis" class="hidden">
<a href="messages.php">
<i class="fa fa-exclamation-triangle"></i>
<span class="label label-warning" id="pihole-diagnosis-count"></span>
Expand Down
4 changes: 0 additions & 4 deletions style/pi-hole.css
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,6 @@
padding: 0 12px;
}

.d-none {
display: none !important;
}

.user-panel > .info > span {
padding-right: 5px;
margin-top: 3px;
Expand Down

0 comments on commit e70e108

Please sign in to comment.