Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #15016 from SietseB/close-bottom-panels
Browse files Browse the repository at this point in the history
Public methods for closing Search Results and References bottom panel
  • Loading branch information
narayani28 authored and Nitesh Kumar committed Mar 25, 2020
1 parent 73f93c0 commit ed93988
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/features/FindReferencesManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ define(function (require, exports, module) {
searchModel.clear();
}

/**
* @public
* Closes the references panel
*/
function closeReferencesPanel() {
if (_resultsView) {
_resultsView.close();
}
}

function setMenuItemStateForLanguage(languageId) {
CommandManager.get(Commands.CMD_FIND_ALL_REFERENCES).setEnabled(false);
if (!languageId) {
Expand Down Expand Up @@ -207,4 +217,5 @@ define(function (require, exports, module) {
exports.registerFindReferencesProvider = registerFindReferencesProvider;
exports.removeFindReferencesProvider = removeFindReferencesProvider;
exports.setMenuItemStateForLanguage = setMenuItemStateForLanguage;
exports.closeReferencesPanel = closeReferencesPanel;
});
10 changes: 10 additions & 0 deletions src/search/FindInFilesUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,15 @@ define(function (require, exports, module) {
}
}

/**
* @public
* Closes the search results panel
*/
function closeResultsPanel() {
_resultsView.close();
_closeFindBar();
}

// Initialize items dependent on HTML DOM
AppInit.htmlReady(function () {
var model = FindInFiles.searchModel;
Expand Down Expand Up @@ -495,6 +504,7 @@ define(function (require, exports, module) {
// Public exports
exports.searchAndShowResults = searchAndShowResults;
exports.searchAndReplaceResults = searchAndReplaceResults;
exports.closeResultsPanel = closeResultsPanel;

// For unit testing
exports._showFindBar = _showFindBar;
Expand Down

0 comments on commit ed93988

Please sign in to comment.