我正在构建一个使用JointsJS + Rappid操作图表的管理工具。我试图将粘贴元素从一张纸A复制到另一张纸B(位于不同的浏览器选项卡上),但我面临以下问题:
在厨房水槽快速演示中,这种行为似乎是一样的:如果我在演示中打开两个选项卡,我将面临完全相同的问题。通过打开演示应用程序的两个选项卡,您可以轻松地复制它。
这是我的代码(直接取自Rappid演示):
this.clipboard = new joint.ui.Clipboard();
this.selection = new joint.ui.Selection({
paper: this.paper,
handles: App.config.selection.handles,
collection: new Backbone.Collection
});
this.keyboard = new joint.ui.Keyboard();
this.keyboard.on({
'ctrl+c': function () {
// Copy all selected elements and their associated links.
this.clipboard.copyElements(this.selection.collection, this.graph);
},
'ctrl+v': function () {
var pastedCells = this.clipboard.pasteCells(this.graph, {
translate: {dx: 20, dy: 20},
useLocalStorage: true
});
var elements = _.filter(pastedCells, function (cell) {
return cell.isElement();
});
// Make sure pasted elements get selected immediately. This makes the UX better as
// the user can immediately manipulate the pasted elements.
this.selection.collection.reset(elements);
},
}
在Rappid文件中指出:
此外,剪贴板还可以从一张纸上复制单元格并粘贴到另一张纸上。然而,目标纸的确定由应用层决定。
我没有完全理解第二句(“然而.”)。结束)。
我监视本地存储,发现这两份文件可能使用相同的存储条目,这使我认为图片粘贴是管理的。
在这个阶段,我很难找到:
谢谢你的帮助。
发布于 2018-12-18 14:03:04
我从Rappid的船员那里得到了一个答案,这是Rappid的一个bug,正在被修复。
修补程序将嵌入下一个版本(可能为2.5)。
https://stackoverflow.com/questions/53636450
复制相似问题