mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
UI hide Devices sections work #612
This commit is contained in:
@@ -1008,7 +1008,7 @@ function setupSmoothScrolling() {
|
||||
var url = window.location.href;
|
||||
if (url.includes("#")) {
|
||||
var idFromURL = url.substring(url.indexOf("#") + 1);
|
||||
if ($("#" + idFromURL).length > 0) {
|
||||
if (idFromURL != "" && $("#" + idFromURL).length > 0) {
|
||||
scrollToElement(idFromURL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,6 +147,36 @@ function initSettingDropdown(settingKey, // Identifier for the setting
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Hide elements on the page based on the supplied setting
|
||||
function hideUIelements(settingKey) {
|
||||
|
||||
hiddenSectionsSetting = getSetting(settingKey)
|
||||
|
||||
if(hiddenSectionsSetting != "") // handle if settings not yet initialized
|
||||
{
|
||||
|
||||
sectionsArray = createArray(hiddenSectionsSetting)
|
||||
|
||||
// remove spaces to get IDs
|
||||
var newArray = $.map(sectionsArray, function(value) {
|
||||
return value.replace(/\s/g, '');
|
||||
});
|
||||
|
||||
$.each(newArray, function(index, hiddenSection) {
|
||||
|
||||
if($('#' + hiddenSection))
|
||||
{
|
||||
$('#' + hiddenSection).hide()
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Data processors
|
||||
|
||||
Reference in New Issue
Block a user