Skip to content

Commit

Permalink
fix: adjust loader parser
Browse files Browse the repository at this point in the history
  • Loading branch information
setaman committed Jan 5, 2021
1 parent faa77d5 commit 4e4250d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/Circle/Circle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</circle>
<fade-in-transition>
<g v-if="isLoading">
<circle-loader :options="options.loader" />
<circle-loader :options="{ ...options, ...options.loader }" />
</g>
</fade-in-transition>
<circle
Expand Down
8 changes: 4 additions & 4 deletions src/components/optionsParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ export const linePositionParser = (linePosition) => {
};
};

export const loaderParser = (loader) => ({
export const loaderParser = (loader, circleLineMode, circleThickness, circleSize) => ({
...loader,
lineMode: loader.lineMode ? lineModeParser(loader.lineMode) : undefined,
thickness: loader.thickness ? calcThickness(loader.thickness) : undefined,
lineMode: lineModeParser(loader.lineMode || circleLineMode, false),
thickness: calcThickness(loader.thickness || circleThickness, circleSize),
});

export const parseOptions = (options) => ({
Expand All @@ -80,5 +80,5 @@ export const parseOptions = (options) => ({
linePosition: linePositionParser(options.linePosition),
emptyLinePosition: linePositionParser(options.emptyLinePosition),
animation: animationParser(options.animation),
loader: loaderParser(options.loader),
loader: loaderParser(options.loader, options.lineMode, options.thickness, options.size),
});

0 comments on commit 4e4250d

Please sign in to comment.