Merge pull request #5391 from Ylianst/scroll-to-top

add scroll to top button
This commit is contained in:
Ylian Saint-Hilaire 2023-10-06 12:17:34 -07:00 committed by GitHub
commit dd172a2b24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -317,6 +317,7 @@
<img style="cursor:pointer;margin-top:4px;display:none" title="Expand All" id="ExpandAllButton" src="images/icon-expand.png" loading=lazy width=9 height=11 onclick="cmexpandaction(1)" />
<input type=button id=SelectAllButton onclick="selectallButtonFunction();" value="Select All" />&nbsp;
<input type=button id=GroupActionButton disabled="disabled" value="Group Action" onclick=groupActionFunction() />&nbsp;
<input type=button id=ScrollToTopButton onclick="onDevicesScroll(true);" value="Scroll To Top" />&nbsp;
<input id=SearchInput type=search autocomplete=off placeholder=Filter onchange=onDeviceSearchChanged(event) onclick=onDeviceSearchChanged(event) onkeyup=onDeviceSearchChanged(event) onfocus=onSearchFocus(1) onblur=onSearchFocus(0) title="Filter: user:xxx or u:xxx ip:xxx group:xxx or g:xxx tag:xxx or t: xxx atag:xxx or a:xxx os:xxx amt:xxx desc:xxx wsc:ok wsc:noav wsc:noupdate wsc:nofirewall wsc:any"/>&nbsp;
<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>
<select id=DevFilterSelect onchange=onOnlineCheckBox(event) title="Device Filter">
@ -339,6 +340,7 @@
<img style="cursor:pointer;margin-top:4px;display:none" title="Expand All" id="ExpandAllButton2" src="images/icon-expand.png" loading=lazy width=9 height=11 onclick="cmexpandaction(1)" />
<input type="button" onclick="connectAllKvmFunction()" value="Connect All" />&nbsp;
<input type="button" onclick="disconnectAllKvmFunction()" value="Disconnect All" />&nbsp;
<input type="button" onclick="onDevicesScroll(true);" value="Scroll To Top" />&nbsp;
<label><input type="checkbox" id="autoConnectDesktopCheckbox" onclick="autoConnectDesktops(event)" title="Automatic connect" />Auto&nbsp;</label>
<input type="button" onclick="showMultiDesktopSettings()" value="Settings" />&nbsp;
<input id=KvmSearchInput type=search placeholder=Filter onchange=onDeviceSearchChanged(event) onclick=onDeviceSearchChanged(event) onkeyup=onDeviceSearchChanged(event) autocomplete=off onfocus=onSearchFocus(1) onblur=onSearchFocus(0) />&nbsp;
@ -399,7 +401,7 @@
</tr>
</table>
</div>
<div id="xdevices" class="noselect" style="display:none" onscroll="onDevicesScroll()"></div>
<div id="xdevices" class="noselect" style="display:none" onscroll="onDevicesScroll(false)"></div>
<div id="xdevicesmap" style="display:none">
<div id=xmapSearchResultsDlg style="display:none">
<div id=xmapSearchResultsBck>
@ -4514,7 +4516,9 @@
var onDevicesTouchActive = false;
var onDevicesScrollnagleTimer = null;
function onDevicesScroll() {
function onDevicesScroll(top) {
if(typeof top == 'undefined') top = false;
if(top) Q('xdevices').scrollTop = 0;
if ((onDevicesScrollnagleTimer != null) || (onDevicesTouchActive)) return;
onDevicesScrollnagleTimer = setTimeout(onDevicesScrollEx, 250);
}