From a62d70eb9d0a2a7a9f33ff8bd4940965f3c285b3 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Thu, 6 May 2021 19:34:46 -0700 Subject: [PATCH] Collapse/expand improvements and fixes. --- MeshCentralServer.njsproj | 1 - public/images/icon-collapse.png | Bin 0 -> 185 bytes public/images/icon-expand.png | Bin 0 -> 189 bytes translate/translate.json | 16 ++++++++----- views/default.handlebars | 40 ++++++++++++++------------------ 5 files changed, 27 insertions(+), 30 deletions(-) create mode 100644 public/images/icon-collapse.png create mode 100644 public/images/icon-expand.png diff --git a/MeshCentralServer.njsproj b/MeshCentralServer.njsproj index 87315857..0c2055a1 100644 --- a/MeshCentralServer.njsproj +++ b/MeshCentralServer.njsproj @@ -555,7 +555,6 @@ - diff --git a/public/images/icon-collapse.png b/public/images/icon-collapse.png new file mode 100644 index 0000000000000000000000000000000000000000..c6433f8b53653fc6e68a593b0b802d2d589a4ddb GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^oIuRY!3HGPMlP2IQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ISV`@iy0XB4uUY_j)~cCfr5UXE{-7@!Mzh4`4|*94$t`i-`I-BO`P|e z${G#9cX@wxZ=_Uk0zPics(J{ df5J`k*VDAsxi_wnVF#Mb;OXk;vd$@?2>@&qI-39h literal 0 HcmV?d00001 diff --git a/public/images/icon-expand.png b/public/images/icon-expand.png new file mode 100644 index 0000000000000000000000000000000000000000..02c91513814b6a838cefa4e9e5865d0f628d4a2d GIT binary patch literal 189 zcmeAS@N?(olHy`uVBq!ia0vp^oIuRY!3HGPMlP2IQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ISV`@iy0XB4uLSEsD@VqP%y~T#W6%9xOYMz7lQ(a^VZ+@Z_Y5;7mtB9}*Pn7?|$hn2s6vs^qY>>!gFQ>-{AoJH%+ gUokcD-;Fm}wk^?RwJhrs0h-R>>FVdQ&MBb@02RYJ5C8xG literal 0 HcmV?d00001 diff --git a/translate/translate.json b/translate/translate.json index 22c1ec3a..7787bcd9 100644 --- a/translate/translate.json +++ b/translate/translate.json @@ -6216,7 +6216,7 @@ "zh-chs": "自动", "zh-cht": "自動", "xloc": [ - "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar->5" + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar->9" ] }, { @@ -6300,7 +6300,7 @@ "zh-chs": "自动连接", "zh-cht": "自動連接", "xloc": [ - "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar->5" + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar->9" ] }, { @@ -8746,6 +8746,8 @@ "zh-chs": "全部收缩", "zh-cht": "全部收縮", "xloc": [ + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar", + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar", "default.handlebars->expandAllContextMenu->3" ] }, @@ -16375,6 +16377,8 @@ "zh-chs": "展开全部", "zh-cht": "展開全部", "xloc": [ + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar", + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar", "default.handlebars->expandAllContextMenu->1" ] }, @@ -28589,7 +28593,7 @@ "xloc": [ "default-mobile.handlebars->container->page_content->column_l->p2->xdevicesBar->1->5", "default.handlebars->31->642", - "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->11->1" + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->15->1" ] }, { @@ -28773,7 +28777,7 @@ "zh-cht": "線上", "xloc": [ "default-mobile.handlebars->container->page_content->column_l->p2->xdevicesBar->1->7", - "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->13->1", + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->17->1", "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->DevFilterSelect->3" ] }, @@ -28837,7 +28841,7 @@ "zh-chs": "仅显示在线设备", "zh-cht": "只顯示在線裝置", "xloc": [ - "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->13" + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->17" ] }, { @@ -36776,7 +36780,7 @@ "zh-chs": "显示设备操作系统名称", "zh-cht": "顯示裝置操作系統名稱", "xloc": [ - "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->11" + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->15" ] }, { diff --git a/views/default.handlebars b/views/default.handlebars index ee03721c..1c77326e 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -255,8 +255,8 @@ -    -   + +       @@ -277,7 +277,9 @@ -     + + +       @@ -1574,7 +1576,7 @@ updateDeskShortcutKeys(); // Override the collapse button text - updateCollapseallButtonText(); + updateCollapseAllButton(); } function refreshCookieSession() { @@ -3875,12 +3877,12 @@ r += '
' + "No Intel® AMT devices in this device group"; if ((meshrights & 4) != 0) { r += ', ' + "add one" + ''; } } else if (mesh.mtype == 2) { - r += ''; - r += '
'; // Open collapse div + r += '
'; // Open collapse div r += '
' + "No devices in this device group"; if ((meshrights & 4) != 0) { r += ', ' + "add one" + ''; } } else if (mesh.mtype == 3) { - r += '
' + "No local devices in this device group"; + r += '
'; // Open collapse div + r += '
' + "No local devices in this device group"; if ((meshrights & 4) != 0) { r += ', ' + "add one" + ''; } } r += '.
'; @@ -4316,7 +4318,7 @@ } Q('DevxColImg' + id).src = x?'images/c2.png':'images/c1.png'; putstore('_collapse', JSON.stringify(CollapsedGroups)); - updateCollapseallButtonText(); + updateCollapseAllButton(); onDevicesScrollEx(); } @@ -4857,20 +4859,12 @@ return "Unknown"; } - function collapseallButtonFunction() { - if (Q('CollapseAllButton').value == "Collapse All") { - cmexpandaction(2); - } else { - cmexpandaction(1); - } - } - - function updateCollapseallButtonText() { - if ((JSON.stringify(getstore('_collapse', '{}')).length - 4) > 0) { - Q('CollapseAllButton').value = "Expand All"; - } else { - Q('CollapseAllButton').value = "Collapse All"; - } + function updateCollapseAllButton() { + var x = (Object.keys(CollapsedGroups).length > 0) + QV('CollapseAllButton', !x); + QV('ExpandAllButton', x); + QV('CollapseAllButton2', !x); + QV('ExpandAllButton2', x); } function selectallButtonFunction() { @@ -5478,7 +5472,7 @@ } } putstore('_collapse', JSON.stringify(CollapsedGroups)); - updateCollapseallButtonText(); + updateCollapseAllButton(); mainUpdate(4); }