.course. navMenuItem

Source:
Functions for interacting with course navigation menu items

Methods

(async) list(optsopt, configopt) → {Promise.<Array.<CanvasTab>>}

Source:
Author:
  • Gabe Abrams
Lists the nav menu items in the course
Parameters:
Name Type Attributes Description
opts object <optional>
object containing all arguments
Properties
Name Type Attributes Description
courseId number <optional>
Canvas course Id
config APIConfig <optional>
custom configuration for this specific endpoint call (overwrites defaults that were included when api was initialized)
Returns:
Type
Promise.<Array.<CanvasTab>>

(async) update(optsopt, configopt) → {Promise.<CanvasTab>}

Source:
Author:
  • Gabe Abrams
Update a nav menu item
Parameters:
Name Type Attributes Description
opts object <optional>
object containing all arguments
Properties
Name Type Attributes Default Description
courseId number <optional>
default course id Canvas course Id
url string <optional>
a url string identifying the item to move to the top of the menu. The url must either be a full url or a path. At least one of url, label, or id must be included. Case insensitive
label string <optional>
a text label identifying the item to move to the top of the menu. At least one of url, label, or id must be included. Case insensitive.
id string <optional>
the id of the item to move to the top of the menu. At least one of url, label, or id must be included. Case sensitive.
moveToTop boolean <optional>
if true, moves the given nav menu item as high up in the nav menu as allowed by Canvas. At best, the position will be set to 2 because position 1 is reserved for the "Home" item.
position number <optional>
the new position of the item (starts at 1)
hidden boolean <optional>
if true, menu item is hidden. if false, menu item is made visible. if excluded, visibility is unchanged.
config APIConfig <optional>
custom configuration for this specific endpoint call (overwrites defaults that were included when api was initialized)
Returns:
Type
Promise.<CanvasTab>