Skip to content

Commit

Permalink
Merge branch 'user_alexey' PRDEV-930 #review
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Lukin committed Jun 1, 2016
2 parents 4fc7fae + 1d97ac6 commit 838736f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/firepad.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,12 +460,18 @@ firepad.Firepad = (function (global) {

Firepad.prototype.cut = function () {
var doc = this.codeMirror_.doc;
this.copyText = doc.getSelection();
doc.replaceSelection('');
var selection = doc.getSelection();
if (selection) {
this.copyText = selection;
doc.replaceSelection('');
}
};
Firepad.prototype.copy = function () {
var doc = this.codeMirror_.doc;
this.copyText = doc.getSelection();
var selection = doc.getSelection();
if (selection) {
this.copyText = selection;
}
};
Firepad.prototype.paste = function () {
var cm = this.codeMirror_,
Expand Down

0 comments on commit 838736f

Please sign in to comment.