From a10232ede0aaa5576290a67ac6e3367eae6d1fc6 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Thu, 4 Oct 2018 11:38:53 +1200 Subject: [PATCH] Fixed issue with copy/paste --- desktop/sources/index.html | 1 + desktop/sources/scripts/dotgrid.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/desktop/sources/index.html b/desktop/sources/index.html index 88af50a..a097e10 100644 --- a/desktop/sources/index.html +++ b/desktop/sources/index.html @@ -49,6 +49,7 @@ dotgrid.controller.add("default","File","Export(.svg)",() => { dotgrid.export(); },"CmdOrCtrl+E"); dotgrid.controller.add_role("default","Edit","copy"); + dotgrid.controller.add_role("default","Edit","paste"); dotgrid.controller.add("default","Edit","Undo",() => { dotgrid.tool.undo() },"CmdOrCtrl+Z"); dotgrid.controller.add("default","Edit","Redo",() => { dotgrid.tool.redo() },"CmdOrCtrl+Shift+Z"); diff --git a/desktop/sources/scripts/dotgrid.js b/desktop/sources/scripts/dotgrid.js index aecc4a3..98f0e38 100644 --- a/desktop/sources/scripts/dotgrid.js +++ b/desktop/sources/scripts/dotgrid.js @@ -252,7 +252,7 @@ function Dotgrid (width, height, grid_x, grid_y, block_x, block_y) { this.paste = function (e) { if (e.target !== this.picker.el) { - const data = e.clipboardData.getData('text/source') + let data = e.clipboardData.getData('text/source') if (is_json(data)) { data = JSON.parse(data.trim()) dotgrid.tool.import(data)