Skip to content

Commit

Permalink
Fixed bug for multiple instances.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsfy committed Jul 25, 2016
1 parent 787afaa commit c38b72b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions cytoscape-clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


var _instance;
var initialized = false;
cytoscape('core', 'clipboard', function (opts) {
var cy = this;

Expand All @@ -21,6 +20,14 @@
$.extend(true, options, opts);


function getScratch() {
if (!cy.scratch("_clipboard")) {
cy.scratch("_clipboard", { });

}
return cy.scratch("_clipboard");
}

var counter = 0;

function guid() {
Expand Down Expand Up @@ -75,10 +82,10 @@

}

if (!initialized) {
initialized = true;
if (!getScratch().isInitialized) {
getScratch().isInitialized = true;
var ur;
var clipboard = {};
var clipboard = {};

_instance = {
copy: function (eles, _id) {
Expand Down

0 comments on commit c38b72b

Please sign in to comment.