Skip to content

Commit

Permalink
Merge pull request bewithjonam#5 from jcisio/patch-1
Browse files Browse the repository at this point in the history
Allow user to override all options
  • Loading branch information
bewithjonam authored Jun 21, 2018
2 parents 0b934dd + 9542452 commit 56c9caa
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
},
NULL_FUNCTION = function () {},
options = {
animate: !!userOptions.animate, // to animate the spiral
animationSpeed: userOptions.animationSpeed || 0, // animation speed in milliseconds
customPin: !!userOptions.customPin, // If false, sets a default icon for pins in spider legs.
initializeLeg: userOptions.initializeLeg || NULL_FUNCTION,
onClick: userOptions.onClick || NULL_FUNCTION,
animate: false, // to animate the spiral
animationSpeed: 0, // animation speed in milliseconds
customPin: false, // If false, sets a default icon for pins in spider legs.
initializeLeg: NULL_FUNCTION,
onClick: NULL_FUNCTION,
// --- <SPIDER TUNING Params>
// circleSpiralSwitchover: show spiral instead of circle from this marker count upwards
// 0 -> always spiral; Infinity -> always circle
Expand All @@ -34,6 +34,10 @@
twoPi = Math.PI * 2,
previousSpiderLegs = [];

for (var attrname in userOptions) {
options[attrname] = userOptions[attrname];
}

// Public:
this.spiderfy = spiderfy;
this.unspiderfy = unspiderfy;
Expand Down

0 comments on commit 56c9caa

Please sign in to comment.