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

Commit

Permalink
Fix for Title bar text and Save button issue for empty active pane (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
sobisht authored and nethip committed Jun 14, 2018
1 parent defded0 commit 10b651b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/document/DocumentCommandHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ define(function (require, exports, module) {
var currentDoc = DocumentManager.getCurrentDocument(),
windowTitle = brackets.config.app_title,
currentlyViewedFile = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE),
currentlyViewedPath = currentlyViewedFile.fullPath,
readOnlyString = currentlyViewedFile.readOnly ? "[Read Only] - " : "";
currentlyViewedPath = currentlyViewedFile && currentlyViewedFile.fullPath,
readOnlyString = (currentlyViewedFile && currentlyViewedFile.readOnly) ? "[Read Only] - " : "";

if (!brackets.nativeMenus) {
if (currentlyViewedPath) {
Expand Down
3 changes: 2 additions & 1 deletion src/extensions/default/RemoteFileAdapter/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ define(function (require, exports, module) {
function _setMenuItemsVisible() {
var file = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE),
cMenuItems = [Commands.FILE_SAVE, Commands.FILE_RENAME, Commands.NAVIGATE_SHOW_IN_FILE_TREE, Commands.NAVIGATE_SHOW_IN_OS],
enable = (file.constructor.name !== "RemoteFile");
// Enable menu options when no file is present in active pane
enable = !file || (file.constructor.name !== "RemoteFile");

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

0 comments on commit 10b651b

Please sign in to comment.