Skip to content

Commit

Permalink
no prevent the copy event when there is selected text
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdibiflator committed Oct 20, 2017
1 parent b3842d9 commit edc30ad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/behavior/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function behaviorCopy(context) {


function doCopy() {
d3_event.preventDefault();
if (!getSelectionText()) d3_event.preventDefault();

var graph = context.graph(),
selected = groupEntities(context.selectedIDs(), graph),
Expand Down Expand Up @@ -87,6 +87,9 @@ export function behaviorCopy(context) {
return copy;
}

function getSelectionText() {
return window.getSelection().toString();
}

copy.off = function() {
d3_select(document).call(keybinding.off);
Expand Down

0 comments on commit edc30ad

Please sign in to comment.