How to hide the "Switch to view mode" button based on a role
Published 01-23-2024
Hi,
I'd like to share 2 additional scripts that might help to hide the "Switch to view mode" and "Share" buttons on the L2025.1 version:
let hidden = false
dashboard.on('widgetinitialized', () => {
if(!hidden){
$('button.btn--switch-mode').remove()
hidden = true
}
})
let hidden = false
dashboard.on('widgetinitialized', () => {
if(!hidden){
$('button.js--btn-dashboard-share').remove()
hidden = true
}
})
Hope that will be helpful 😊
Regards, Lily