src/extensions/default/RecentProjects/main.js
function showDropdown(position) {
        // If the dropdown is already visible, just return (so the root click handler on html
        // will close it).
        if ($dropdown) {
            return;
        }

        Menus.closeAll();

        $dropdown = $(renderList())
            .css({
                left: position.pageX,
                top: position.pageY
            })
            .appendTo($("body"));

        PopUpManager.addPopUp($dropdown, cleanupDropdown, true);

        // TODO: should use capture, otherwise clicking on the menus doesn't close it. More fallout
        // from the fact that we can't use the Boostrap (1.4) dropdowns.
        $("html").on("click", closeDropdown);

        // Hide the menu if the user scrolls in the project tree. Otherwise the Lion scrollbar
        // overlaps it.
        // TODO: This duplicates logic that's already in ProjectManager (which calls Menus.close()).
        // We should fix this when the popup handling is centralized in PopupManager, as well
        // as making Esc close the dropdown. See issue #1381.
        $("#project-files-container").on("scroll", closeDropdown);

        // Note: PopUpManager will automatically hide the sidebar in other cases, such as when a
        // command is run, Esc is pressed, or the menu is focused.

        // Hacky: if we detect a click in the menubar, close ourselves.
        // TODO: again, we should have centralized popup management.
        $("#titlebar .nav").on("click", closeDropdown);

        _handleListEvents();
        $(window).on("keydown", keydownHook);
    }
function showDropdown(position) {
        // If the dropdown is already visible, just return (so the root click handler on html
        // will close it).
        if ($dropdown) {
            return;
        }

        Menus.closeAll();

        $dropdown = $(renderList())
            .css({
                left: position.pageX,
                top: position.pageY
            })
            .appendTo($("body"));

        PopUpManager.addPopUp($dropdown, cleanupDropdown, true);

        // TODO: should use capture, otherwise clicking on the menus doesn't close it. More fallout
        // from the fact that we can't use the Boostrap (1.4) dropdowns.
        $("html").on("click", closeDropdown);

        // Hide the menu if the user scrolls in the project tree. Otherwise the Lion scrollbar
        // overlaps it.
        // TODO: This duplicates logic that's already in ProjectManager (which calls Menus.close()).
        // We should fix this when the popup handling is centralized in PopupManager, as well
        // as making Esc close the dropdown. See issue #1381.
        $("#project-files-container").on("scroll", closeDropdown);

        // Note: PopUpManager will automatically hide the sidebar in other cases, such as when a
        // command is run, Esc is pressed, or the menu is focused.

        // Hacky: if we detect a click in the menubar, close ourselves.
        // TODO: again, we should have centralized popup management.
        $("#titlebar .nav").on("click", closeDropdown);

        _handleListEvents();
        $(window).on("keydown", keydownHook);
    }
function showDropdown ( position ) { // If the dropdown is already visible, just return (so the root click handler on html // will close it). if ( $dropdown ) { return ; } Menus . closeAll ( ) ; $dropdown = $ ( renderList ( ) ) . css ( { left : position . pageX , top : position . pageY } ) . appendTo ( $ ( "body" ) ) ; PopUpManager . addPopUp ( $dropdown , cleanupDropdown , true ) ; // TODO: should use capture, otherwise clicking on the menus doesn't close it. More fallout // from the fact that we can't use the Boostrap (1.4) dropdowns. $ ( "html" ) . on ( "click" , closeDropdown ) ; // Hide the menu if the user scrolls in the project tree. Otherwise the Lion scrollbar // overlaps it. // TODO: This duplicates logic that's already in ProjectManager (which calls Menus.close()). // We should fix this when the popup handling is centralized in PopupManager, as well // as making Esc close the dropdown. See issue #1381. $ ( "#project-files-container" ) . on ( "scroll" , closeDropdown ) ; // Note: PopUpManager will automatically hide the sidebar in other cases, such as when a // command is run, Esc is pressed, or the menu is focused. // Hacky: if we detect a click in the menubar, close ourselves. // TODO: again, we should have centralized popup management. $ ( "#titlebar .nav" ) . on ( "click" , closeDropdown ) ; _handleListEvents ( ) ; $ ( window ) . on ( "keydown" , keydownHook ) ; }
Show or hide the recent projects dropdown.

@param {{pageX:number, pageY:number}} position - the absolute position where to open the dropdown
Show or hide the recent projects dropdown .