src/command/Menus.js
function ContextMenu(id) {
        Menu.apply(this, arguments);

        var $newMenu = $("<li class='dropdown context-menu' id='" + StringUtils.jQueryIdEscape(id) + "'></li>"),
            $popUp = $("<ul class='dropdown-menu'></ul>"),
            $toggle = $("<a href='#' class='dropdown-toggle' data-toggle='dropdown'></a>").hide();

        // assemble the menu fragments
        $newMenu.append($toggle).append($popUp);

        // insert into DOM
        $("#context-menu-bar > ul").append($newMenu);

        var self = this;
        PopUpManager.addPopUp($popUp,
            function () {
                self.close();
            },
            false);

        // Listen to ContextMenu's beforeContextMenuOpen event to first close other popups
        PopUpManager.listenToContextMenu(this);
    }
function ContextMenu(id) {
        Menu.apply(this, arguments);

        var $newMenu = $("<li class='dropdown context-menu' id='" + StringUtils.jQueryIdEscape(id) + "'></li>"),
            $popUp = $("<ul class='dropdown-menu'></ul>"),
            $toggle = $("<a href='#' class='dropdown-toggle' data-toggle='dropdown'></a>").hide();

        // assemble the menu fragments
        $newMenu.append($toggle).append($popUp);

        // insert into DOM
        $("#context-menu-bar > ul").append($newMenu);

        var self = this;
        PopUpManager.addPopUp($popUp,
            function () {
                self.close();
            },
            false);

        // Listen to ContextMenu's beforeContextMenuOpen event to first close other popups
        PopUpManager.listenToContextMenu(this);
    }
function ContextMenu ( id ) { Menu . apply ( this , arguments ) ; var $newMenu = $ ( "<li class='dropdown context-menu' id='" + StringUtils . jQueryIdEscape ( id ) + "'></li>" ) , $popUp = $ ( "<ul class='dropdown-menu'></ul>" ) , $toggle = $ ( "<a href='#' class='dropdown-toggle' data-toggle='dropdown'></a>" ) . hide ( ) ; // assemble the menu fragments $newMenu . append ( $toggle ) . append ( $popUp ) ; // insert into DOM $ ( "#context-menu-bar > ul" ) . append ( $newMenu ) ; var self = this ; PopUpManager . addPopUp ( $popUp , function ( ) { self . close ( ) ; } , false ) ; // Listen to ContextMenu's beforeContextMenuOpen event to first close other popups PopUpManager . listenToContextMenu ( this ) ; }
Represents a context menu that can open at a specific location in the UI.

Clients should not create this object directly and should instead use registerContextMenu()
to create new ContextMenu objects.

Context menus in brackets may be HTML-based or native so clients should not reach into
the HTML and should instead manipulate ContextMenus through the API.

Events:
- beforeContextMenuOpen
- beforeContextMenuClose

@constructor
@extends {Menu}
Represents a context menu that can open at a specific location in the UI .