Merge pull request #4456 from ferdibiflator/copyable-content-within-info-panels

Copyable content text
This commit is contained in:
Bryan Housel
2017-10-20 13:53:51 -04:00
committed by GitHub

View File

@@ -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),
@@ -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);