1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #4306: Fix toggling of device images for all racks in elevations view

This commit is contained in:
Jeremy Stretch
2020-03-03 10:04:35 -05:00
parent 7b6bd75c22
commit 78a1aad6c0
3 changed files with 6 additions and 8 deletions

View File

@@ -1,14 +1,11 @@
// Toggle the display of device images within an SVG rack elevation
$('button.toggle-images').click(function() {
var selected = $(this).attr('selected');
var rack_front = $("#rack_front");
var rack_rear = $("#rack_rear");
var rack_elevation = $(".rack_elevation");
if (selected) {
$('.device-image', rack_front.contents()).addClass('hidden');
$('.device-image', rack_rear.contents()).addClass('hidden');
$('.device-image', rack_elevation.contents()).addClass('hidden');
} else {
$('.device-image', rack_front.contents()).removeClass('hidden');
$('.device-image', rack_rear.contents()).removeClass('hidden');
$('.device-image', rack_elevation.contents()).removeClass('hidden');
}
$(this).attr('selected', !selected);
$(this).children('span').toggleClass('glyphicon-check glyphicon-unchecked');