mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-02 17:35:57 -05:00
Merge pull request #2595 from nzalev/expand/collapse-button
Added collapse/expand all button
This commit is contained in:
commit
a76265ca6f
@ -255,7 +255,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class=h1></td>
|
<td class=h1></td>
|
||||||
<td id=devListToolbar class=style14 style="display:none">
|
<td id=devListToolbar class=style14 style="display:none">
|
||||||
<input type="button" id="SelectAllButton" onclick="selectallButtonFunction();" value="Select All" />
|
|
||||||
|
<input type="button" id="CollapseAllButton" onclick="collapseallButtonFunction();" value="Collapse All" />
|
||||||
|
<input type="button" id="SelectAllButton" onclick="selectallButtonFunction();" value="Select All" />
|
||||||
<input type=button id=GroupActionButton disabled="disabled" value="Group Action" onclick=groupActionFunction() />
|
<input type=button id=GroupActionButton disabled="disabled" value="Group Action" onclick=groupActionFunction() />
|
||||||
<input id=SearchInput type=search autocomplete=off placeholder=Filter onchange=onDeviceSearchChanged(event) onkeyup=onDeviceSearchChanged(event) onfocus=onSearchFocus(1) onblur=onSearchFocus(0) />
|
<input id=SearchInput type=search autocomplete=off placeholder=Filter onchange=onDeviceSearchChanged(event) onkeyup=onDeviceSearchChanged(event) onfocus=onSearchFocus(1) onblur=onSearchFocus(0) />
|
||||||
<span id=SearchInputClearButton style="display:none;position:relative"><img src="images/x16.png" type="button" onclick="clearDeviceSearch()" style="position:absolute;cursor:pointer;left:-18px;top:-8px" srcset="images/x32.png 2x"/></span>
|
<span id=SearchInputClearButton style="display:none;position:relative"><img src="images/x16.png" type="button" onclick="clearDeviceSearch()" style="position:absolute;cursor:pointer;left:-18px;top:-8px" srcset="images/x32.png 2x"/></span>
|
||||||
@ -1570,6 +1572,9 @@
|
|||||||
var deskKeyboardShortcutsStr = getstore('deskKeyShortcuts', '0x0A002E,0x100000,0x100028,0x100026,0x10004C,0x10004D,0x11004D,0x100052,0x020073,0x080057,0x020009,0x100025,0x100027').split(',');
|
var deskKeyboardShortcutsStr = getstore('deskKeyShortcuts', '0x0A002E,0x100000,0x100028,0x100026,0x10004C,0x10004D,0x11004D,0x100052,0x020073,0x080057,0x020009,0x100025,0x100027').split(',');
|
||||||
for (var i in deskKeyboardShortcutsStr) { deskKeyboardShortcuts.push(parseInt(deskKeyboardShortcutsStr[i])); }
|
for (var i in deskKeyboardShortcutsStr) { deskKeyboardShortcuts.push(parseInt(deskKeyboardShortcutsStr[i])); }
|
||||||
updateDeskShortcutKeys();
|
updateDeskShortcutKeys();
|
||||||
|
|
||||||
|
// Override the collapse button text
|
||||||
|
updateCollapseallButtonText();
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshCookieSession() {
|
function refreshCookieSession() {
|
||||||
@ -4311,6 +4316,7 @@
|
|||||||
}
|
}
|
||||||
Q('DevxColImg' + id).src = x?'images/c2.png':'images/c1.png';
|
Q('DevxColImg' + id).src = x?'images/c2.png':'images/c1.png';
|
||||||
putstore('_collapse', JSON.stringify(CollapsedGroups));
|
putstore('_collapse', JSON.stringify(CollapsedGroups));
|
||||||
|
updateCollapseallButtonText();
|
||||||
onDevicesScrollEx();
|
onDevicesScrollEx();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4851,6 +4857,22 @@
|
|||||||
return "Unknown";
|
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 selectallButtonFunction() {
|
function selectallButtonFunction() {
|
||||||
var elements = document.getElementsByClassName('DeviceCheckbox'), checkcount = Object.keys(checkedNodeids).length;
|
var elements = document.getElementsByClassName('DeviceCheckbox'), checkcount = Object.keys(checkedNodeids).length;
|
||||||
for (var i = 0; i < elements.length; i++) { elements[i].checked = (checkcount == 0); }
|
for (var i = 0; i < elements.length; i++) { elements[i].checked = (checkcount == 0); }
|
||||||
@ -5456,6 +5478,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
putstore('_collapse', JSON.stringify(CollapsedGroups));
|
putstore('_collapse', JSON.stringify(CollapsedGroups));
|
||||||
|
updateCollapseallButtonText();
|
||||||
mainUpdate(4);
|
mainUpdate(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user