From 437e8e06eb32ffe21111f0946115aae0e4c33381 Mon Sep 17 00:00:00 2001 From: Kim <1877318+kimsible@users.noreply.github.com> Date: Wed, 15 Apr 2020 15:35:41 +0200 Subject: Add custom modal to plugin helpers (#2631) * Add custom modal component * Add custom modal to app and plugins helpers * Fixes custom modal component * Add doc for custom modal * Fix newline end of file html and scss files * Move my-custom-modal component outside component for UserLoggedIn modals * Move initializeCustomModal to ngAfterViewInit() * Wrap events and conditionnals * Replace ng-show with ngIf* * Add modalRef to open only one modal + onCloseClick * Refacto + Fix access methods of custom modal * Fix methods names custom-modal.component * Fix implement AfterViewInit & no default boolean Co-authored-by: kimsible --- support/doc/plugins/guide.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'support') diff --git a/support/doc/plugins/guide.md b/support/doc/plugins/guide.md index 5251ce48a..e6870ce17 100644 --- a/support/doc/plugins/guide.md +++ b/support/doc/plugins/guide.md @@ -216,6 +216,24 @@ notifier.success('Success message content.') notifier.error('Error message content.') ``` +#### Custom Modal + +To show a custom modal: + +```js + peertubeHelpers.showModal({ + title: 'My custom modal title', + content: '

My custom modal content

', + // Optionals parameters : + // show close icon + close: true, + // show cancel button and call action() after hiding modal + cancel: { value: 'cancel', action: () => {} }, + // show confirm button and call action() after hiding modal + confirm: { value: 'confirm', action: () => {} }, + }) +``` + #### Translate You can translate some strings of your plugin (PeerTube will use your `translations` object of your `package.json` file): -- cgit v1.2.3