Is there a way to have a navigation button actively display only for mobile users?

Jump to solution
canvas_admin
Community Champion

I would like for the "Discussions" button to appear in the navigation menu when users are accessing the course via the Canvas mobile app (android and iOS), but have it hidden when users access the course via a web browser on a laptop/desktop.   Does anybody know if this would be possible and, if so, how they might go about doing it?

1 Solution
MattHanes
Community Champion

You can hide it with custom Javascript but if they know the URL, they will still be able to get to the discussions page. For example, the following code will hide the Discussions tab for everyone that is not an admin.

if (ENV.current_user_roles.indexOf("admin") < 1){

  $( document ).ready(function() {

$('#section-tabs a.discussions').hide();

});

}

View solution in original post