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

Public methods for closing Search Results and References bottom panel #15016

Merged
merged 1 commit into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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