Skip to content

Commit

Permalink
end renaming resource in editor when focus is lost #176
Browse files Browse the repository at this point in the history
  • Loading branch information
mciissee committed Jan 31, 2019
1 parent 25d64c3 commit 67b51f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
type='text'
placeholder='Press enter to create esc to cancel...'
auto-focus='true' ng-model='resource.name'
ng-blur='explorer.endEditing(resource, $event)'
ng-keydown='explorer.endEditing(resource, $event)'/>
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function ExplorerComponent(EditorService, MonacoService, $scope) {
EditorService.logError(error);
});
}
else if (e.keyCode === 27) { // esc
else if (e.keyCode === 27 || e.type === 'blur') { // esc
EditorService.cancelEdition(resource);
}
};
Expand Down

0 comments on commit 67b51f9

Please sign in to comment.