Fixed issue with copy/paste
This commit is contained in:
parent
fce187e04c
commit
a10232ede0
@ -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");
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user