Create a plugin to run scripts for all dashboards
Hi all,
Running scripts for all dashboards - we've seen this request a lot in the community. And just recently Kobbi Gal has shared a way to apply a script to all dashboards, instead of manually editing each dashboard script. Here are the steps, give it a shot and let us know how it goes!
2) Open widget.js for editing.
3) In this file, we'll use the dashboardLoaded event to register the logic when the dashboard finished loading. For example, if we'd like to remove the new widget button if the logged in user is a designer:
// registering the event handler
prism.on("dashboardloaded", function(){
if (prism.user.roleName == 'contributor'){
$('.new-widget').remove();
console.log("Designer logged in -> new widget button removed");
}
});
Please sign in to leave a comment.
Comments
0 comments