Skip to content

Commit

Permalink
merge option added to setOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Kutlu Sahin committed Mar 28, 2019
1 parent 136e6d5 commit 9f4688f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 711,12 @@ function Container(element: HTMLElement): (options?: ContainerOptions) => IConta
unwrapChildren(container.element);
}

function setOptions(options: ContainerOptions) {
containerOptions = Object.assign({}, defaultOptions, containerOptions, options);
function setOptions(options: ContainerOptions, merge = true) {
if (merge === false) {
containerOptions = Object.assign({}, defaultOptions, options);
} else {
containerOptions = Object.assign({}, defaultOptions, containerOptions, options);
}
}

function getOptions(): ContainerOptions {
Expand Down
2 changes: 1 addition & 1 deletion src/exportTypes.ts
Original file line number Diff line number Diff line change
@@ -1,6 1,6 @@
export interface SmoothDnD {
dispose: () => void;
setOptions: (options: ContainerOptions) => void;
setOptions: (options: ContainerOptions, merge?: boolean) => void;
}

export type SmoothDnDCreator = ((element: HTMLElement, options?: ContainerOptions) => SmoothDnD) & {
Expand Down

0 comments on commit 9f4688f

Please sign in to comment.