@@ -9,7 +9,7 @@ import { jsonrepair } from "jsonrepair";
9
9
// GLOBAL VARIABLES
10
10
var jsonDeviceArray = [ ] ;
11
11
var jsonStringCopy = "" ;
12
- var errorNotifColor = "#d72a6f" ;
12
+ var errorNotifColor = "#d72a6f" ;
13
13
var successNotifColor = "#20ad6b" ;
14
14
var neutralNotifColor = "#8f6ac4" ;
15
15
@@ -32,6 +32,8 @@ $(document).ready(function () {
32
32
}
33
33
) ;
34
34
35
+ sortAndAppendContainers ( ) ;
36
+
35
37
// Closing modals
36
38
$ ( '[data-dismiss="modalLabel"]' ) . on ( "click" , function ( ) {
37
39
$ ( "#exportDeviceModal" ) . modal ( "hide" ) ;
@@ -65,6 +67,22 @@ window.toggleExportMenuVisibility = function () {
65
67
}
66
68
} ;
67
69
70
+ // Sorting camera cards by height
71
+ window . sortAndAppendContainers = function ( ) {
72
+ var containers = $ ( '[data-card="container"]' ) ;
73
+
74
+ containers . sort ( function ( a , b ) {
75
+ // Compare the heights of the camera containers in descending order
76
+ var heightA = $ ( a ) . find ( '[data-card="cameraContainer"]' ) . height ( ) ;
77
+ var heightB = $ ( b ) . find ( '[data-card="cameraContainer"]' ) . height ( ) ;
78
+
79
+ return heightA - heightB ;
80
+ } ) ;
81
+
82
+ // Append the sorted camera containers back to the parent containers with data-card="container"
83
+ $ ( '#sortedCameraCards' ) . empty ( ) . append ( containers ) ;
84
+ }
85
+
68
86
window . resetLabels = function ( ) {
69
87
$ ( '#dynamicKeys input[type="checkbox"]' ) . prop ( "checked" , false ) . change ( ) ;
70
88
$ ( "[id^=btnRenameInput_]" ) . val ( null ) ;
0 commit comments