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

Commit 10b651b

Browse files
sobishtnethip
authored andcommitted
Fix for Title bar text and Save button issue for empty active pane (#14421)
* Adding null checks to fix title change issue * Change the menu items visibility when file is present in active pane * Enable Menu options when no file is present in active pane
1 parent defded0 commit 10b651b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/document/DocumentCommandHandlers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ define(function (require, exports, module) {
158158
var currentDoc = DocumentManager.getCurrentDocument(),
159159
windowTitle = brackets.config.app_title,
160160
currentlyViewedFile = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE),
161-
currentlyViewedPath = currentlyViewedFile.fullPath,
162-
readOnlyString = currentlyViewedFile.readOnly ? "[Read Only] - " : "";
161+
currentlyViewedPath = currentlyViewedFile && currentlyViewedFile.fullPath,
162+
readOnlyString = (currentlyViewedFile && currentlyViewedFile.readOnly) ? "[Read Only] - " : "";
163163

164164
if (!brackets.nativeMenus) {
165165
if (currentlyViewedPath) {

src/extensions/default/RemoteFileAdapter/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ define(function (require, exports, module) {
5959
function _setMenuItemsVisible() {
6060
var file = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE),
6161
cMenuItems = [Commands.FILE_SAVE, Commands.FILE_RENAME, Commands.NAVIGATE_SHOW_IN_FILE_TREE, Commands.NAVIGATE_SHOW_IN_OS],
62-
enable = (file.constructor.name !== "RemoteFile");
62+
// Enable menu options when no file is present in active pane
63+
enable = !file || (file.constructor.name !== "RemoteFile");
6364

6465
// Enable or disable commands based on whether the file is a remoteFile or not.
6566
cMenuItems.forEach(function (item) {

0 commit comments

Comments
 (0)