Skip to content

Commit

Permalink
FIx focus issue of editor
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan687 committed Sep 23, 2016
1 parent 64f28bf commit 77dc70e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/result/result.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ export class ResultComponent implements OnInit {
self.result.output = JSON.stringify(res.json(), null, 2);
if($('#resultModal').hasClass('in')) {
self.responseHookHelp.setValue(self.result.output);
self.responseHookHelp.focus();
} else {
setTimeout(function() {
self.responseHookHelp.setValue(self.result.output);
self.responseHookHelp.focus();
}, 300);
}

Expand Down
3 changes: 3 additions & 0 deletions app/shared/editorHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ EditorHook.prototype.applyEditor = function(settings) {

EditorHook.prototype.setValue = function(value) {
this.editor.setValue(value);
}

EditorHook.prototype.focus = function(value) {
this.editor.focus();
}

Expand Down

0 comments on commit 77dc70e

Please sign in to comment.