Skip to content

Commit

Permalink
Bug fix for api.extendOptions()
Browse files Browse the repository at this point in the history
  • Loading branch information
metincansiper committed Aug 7, 2019
1 parent 7b6ae3e commit 7f9a67b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
19 changes: 11 additions & 8 deletions cytoscape-expand-collapse.js

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,22 @@
};

api.extendOptions = function(opts) {
handleNewOptions(opts);
var options = getScratch(cy, 'options');
extendOptions( options, opts );
let newOptions = extendOptions( options, opts );
handleNewOptions(newOptions);
setScratch(cy, 'options', newOptions);
}

// set the option whose name is given
api.setOption = function (name, value) {
var nameToVal = {};
nameToVal[ name ] = value;
var opts = {};
opts[ name ] = value;

var options = getScratch(cy, 'options');
let newOptions = extendOptions( options, opts );

handleNewOptions(nameToVal);
getScratch(cy, 'options')[name] = value;
handleNewOptions(newOptions);
setScratch(cy, 'options', newOptions);
};

// Collection functions
Expand Down

0 comments on commit 7f9a67b

Please sign in to comment.