Skip to content

Commit a40fcd3

Browse files
authored
Merge pull request #1403 from shakti97/Enhancement-Esc-Function
Enhancement(Esc key hide modal)
2 parents 1747ba7 + b16f628 commit a40fcd3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: client/modules/IDE/pages/IDEView.jsx

+9
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,14 @@ class IDEView extends React.Component {
170170
} else {
171171
this.props.expandConsole();
172172
}
173+
} else if (e.keyCode === 27) {
174+
if (this.props.ide.newFolderModalVisible) {
175+
this.props.closeNewFolderModal();
176+
} else if (this.props.ide.uploadFileModalVisible) {
177+
this.props.closeUploadFileModal();
178+
} else if (this.props.ide.modalIsVisible) {
179+
this.props.closeNewFileModal();
180+
}
173181
}
174182
}
175183

@@ -562,6 +570,7 @@ IDEView.propTypes = {
562570
closeProjectOptions: PropTypes.func.isRequired,
563571
newFolder: PropTypes.func.isRequired,
564572
closeNewFolderModal: PropTypes.func.isRequired,
573+
closeNewFileModal: PropTypes.func.isRequired,
565574
createFolder: PropTypes.func.isRequired,
566575
closeShareModal: PropTypes.func.isRequired,
567576
showEditorOptions: PropTypes.func.isRequired,

0 commit comments

Comments
 (0)