mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-21 09:51:11 +00:00
Migrate Collapse/Open Resource Tree to React (#733)
Co-authored-by: Steve Faulkner <southpolesteve@gmail.com>
This commit is contained in:
committed by
GitHub
parent
8e6d274b11
commit
d7c62ac7f1
@@ -134,7 +134,6 @@ export default class Explorer {
|
||||
public databases: ko.ObservableArray<ViewModels.Database>;
|
||||
public selectedDatabaseId: ko.Computed<string>;
|
||||
public selectedCollectionId: ko.Computed<string>;
|
||||
public isLeftPaneExpanded: ko.Observable<boolean>;
|
||||
public selectedNode: ko.Observable<ViewModels.TreeNode>;
|
||||
private resourceTree: ResourceTreeAdapter;
|
||||
|
||||
@@ -231,6 +230,7 @@ export default class Explorer {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.isNotebooksEnabledForAccount = ko.observable(false);
|
||||
this.isNotebooksEnabledForAccount.subscribe((isEnabledForAccount: boolean) => this.refreshCommandBarButtons());
|
||||
this.isSparkEnabledForAccount = ko.observable(false);
|
||||
@@ -335,7 +335,6 @@ export default class Explorer {
|
||||
}
|
||||
return true;
|
||||
});
|
||||
this.isLeftPaneExpanded = ko.observable<boolean>(true);
|
||||
this.selectedNode = ko.observable<ViewModels.TreeNode>();
|
||||
this.selectedNode.subscribe((nodeSelected: ViewModels.TreeNode) => {
|
||||
// Make sure switching tabs restores tabs display
|
||||
@@ -675,16 +674,8 @@ export default class Explorer {
|
||||
this.setIsNotificationConsoleExpanded(true);
|
||||
}
|
||||
|
||||
public toggleLeftPaneExpanded() {
|
||||
this.isLeftPaneExpanded(!this.isLeftPaneExpanded());
|
||||
|
||||
if (this.isLeftPaneExpanded()) {
|
||||
document.getElementById("expandToggleLeftPaneButton").focus();
|
||||
this.splitter.expandLeft();
|
||||
} else {
|
||||
document.getElementById("collapseToggleLeftPaneButton").focus();
|
||||
this.splitter.collapseLeft();
|
||||
}
|
||||
public collapseConsole(): void {
|
||||
this.setIsNotificationConsoleExpanded(false);
|
||||
}
|
||||
|
||||
public refreshDatabaseForResourceToken(): Q.Promise<any> {
|
||||
@@ -803,14 +794,6 @@ export default class Explorer {
|
||||
this.refreshNotebookList();
|
||||
};
|
||||
|
||||
public toggleLeftPaneExpandedKeyPress = (source: any, event: KeyboardEvent): boolean => {
|
||||
if (event.keyCode === Constants.KeyCodes.Space || event.keyCode === Constants.KeyCodes.Enter) {
|
||||
this.toggleLeftPaneExpanded();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
// Facade
|
||||
public provideFeedbackEmail = () => {
|
||||
window.open(Constants.Urls.feedbackEmail, "_blank");
|
||||
|
||||
Reference in New Issue
Block a user