add scroll to top button
Signed-off-by: Simon Smith <simonsmith5521@gmail.com>
Simon Smith committed
Oct 4, 2023 at 16:16 UTC
2b5e0e23bec4bf4b8c4c0dd87b2bd18de92f5e66
1 file changed
+6
-2
views/default.handlebars
+6
-2
@@ -316,6 +316,7 @@
316
<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)" />
317
<input type=button id=SelectAllButton onclick="selectallButtonFunction();" value="Select All" />
318
<input type=button id=GroupActionButton disabled="disabled" value="Group Action" onclick=groupActionFunction() />
319
+ <input type=button id=ScrollToTopButton onclick="onDevicesScroll(true);" value="Scroll To Top" />
320
<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"/>
321
<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>
322
<select id=DevFilterSelect onchange=onOnlineCheckBox(event) title="Device Filter">
@@ -338,6 +339,7 @@
339
<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)" />
340
<input type="button" onclick="connectAllKvmFunction()" value="Connect All" />
341
<input type="button" onclick="disconnectAllKvmFunction()" value="Disconnect All" />
342
+ <input type="button" onclick="onDevicesScroll(true);" value="Scroll To Top" />
343
<label><input type="checkbox" id="autoConnectDesktopCheckbox" onclick="autoConnectDesktops(event)" title="Automatic connect" />Auto </label>
344
<input type="button" onclick="showMultiDesktopSettings()" value="Settings" />
345
<input id=KvmSearchInput type=search placeholder=Filter onchange=onDeviceSearchChanged(event) onclick=onDeviceSearchChanged(event) onkeyup=onDeviceSearchChanged(event) autocomplete=off onfocus=onSearchFocus(1) onblur=onSearchFocus(0) />
@@ -398,7 +400,7 @@
400
</tr>
401
</table>
402
</div>
401
- <div id="xdevices" class="noselect" style="display:none" onscroll="onDevicesScroll()"></div>
403
+ <div id="xdevices" class="noselect" style="display:none" onscroll="onDevicesScroll(false)"></div>
404
<div id="xdevicesmap" style="display:none">
405
<div id=xmapSearchResultsDlg style="display:none">
406
<div id=xmapSearchResultsBck>
@@ -4512,7 +4514,9 @@
4514
4515
var onDevicesTouchActive = false;
4516
var onDevicesScrollnagleTimer = null;
4515
- function onDevicesScroll() {
4517
+ function onDevicesScroll(top) {
4518
+ if(typeof top == 'undefined') top = false;
4519
+ if(top) Q('xdevices').scrollTop = 0;
4520
if ((onDevicesScrollnagleTimer != null) || (onDevicesTouchActive)) return;
4521
onDevicesScrollnagleTimer = setTimeout(onDevicesScrollEx, 250);
4522
}