Skip to content

Commit

Permalink
feat(swal-partial-targets): mark "buttonsWrapper" as deprecated, add …
Browse files Browse the repository at this point in the history
…new "actions" target
  • Loading branch information
toverux committed Jan 27, 2018
1 parent 1b1cb32 commit d3e2295
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,4 @@ And then, set the appropriate target as the value of `*swalPartial`.
<swal>
```

We have the following targets: `title`, `content`, `confirmButton`, `cancelButton`, `buttonsWrapper`. These are provided by SweetAlert2.
We have the following targets: `title`, `content`, `actions`, `confirmButton`, `cancelButton`. These are provided by SweetAlert2.
11 changes: 10 additions & 1 deletion src/swal-partial-targets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,17 @@ import swal from 'sweetalert2';
*/
export class SwalPartialTargets {
public readonly title = () => swal.getTitle();

public readonly content = () => swal.getContent();

/**
* @deprecated Will be removed in the next major version, please use {@link SwalPartialTargets#actions} instead.
*/
public readonly buttonsWrapper = () => swal.getButtonsWrapper();

public readonly actions = () => swal.getActions();

public readonly confirmButton = () => swal.getConfirmButton();

public readonly cancelButton = () => swal.getCancelButton();
public readonly buttonsWrapper = () => swal.getButtonsWrapper();
}

0 comments on commit d3e2295

Please sign in to comment.