Skip to content

Commit

Permalink
Merge pull request #248 from ybart/master
Browse files Browse the repository at this point in the history
Fix copy on Safari
  • Loading branch information
gsamokovarov authored Oct 5, 2017
2 parents 0f65b93 + 1f0ca5b commit 56b9253
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/web_console/templates/console.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ REPLConsole.prototype.getSuggestion = function(keyword) {
hint.className = 'console-hint';
hint.dataset.keyword = found;
hint.innerText = found.substr(self.suggestKeyword.length);
// clear hinting information after timeout in a few time
// clear hinting information after timeout in a few time
if (self.suggestTimeout) clearTimeout(self.suggestTimeout);
self.suggestTimeout = setTimeout(function() { self.renderInput() }, self.suggestWait);
}
Expand Down Expand Up @@ -710,9 +710,10 @@ REPLConsole.prototype.onKeyDown = function(ev) {
}

if (ev.ctrlKey || ev.metaKey) {
// Set focus to our clipboard in case they hit the "v" key
this.clipboard.focus();
if (ev.keyCode == 86) {
// Set focus to our clipboard when they hit the "v" key
this.clipboard.focus();

// Pasting to clipboard doesn't happen immediately,
// so we have to wait for a while to get the pasted text.
var _this = this;
Expand Down

0 comments on commit 56b9253

Please sign in to comment.