Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
Foundry Virtual Tabletop
Foundry Virtual Tabletop
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 594
    • Issues 594
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 0
    • Merge Requests 0
  • Requirements
    • Requirements
    • List
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Foundry Network
  • Foundry Virtual TabletopFoundry Virtual Tabletop
  • Issues
  • #443

Closed
Open
Opened Feb 16, 2019 by Andrew@aaclaytonOwner

Allow hooks to extend context menu options for SidebarDirectory lists

Added hooks to all Sidebar tabs for the following events:

get<ClassName>FolderContext

get<ClassName>EntryContext

Both events transact the HTML of the sidebar and the options object which defines the ContextMenu instance. Example of adding a new button to the Actor List:

Hooks.on("getActorListEntryContext", (html, options) => {
    options["New Button"] = {
      icon: '<i class="fas fa-feather"></i>',
      callback: li => console.log(li),
      condition: 1 === 1
    };
});

SidebarDirectory subclasses support both hook events. These are:

ActorDirectory
ItemDirectory
JournalDirectory
PlaylistDirectory
SceneDirectory

Other sidebar tabs support the same apu for get<ClassName>EntryContext for consistency, however do not have a concept of folders and therefore do not support the "FolderContext" hook. These are:

ChatLog
CombatTracker
CompendiumList
Edited Feb 18, 2019 by Andrew
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Beta 0.2.1
Milestone
Beta 0.2.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: foundrynet/foundryvtt#443