From 4660c428682387ab85dc7453ee77620c06cc9a38 Mon Sep 17 00:00:00 2001 From: Bauke Date: Fri, 18 Mar 2022 00:09:09 +0100 Subject: [PATCH] Make the Save button show feedback on save. --- source/options/components/page-main.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/source/options/components/page-main.ts b/source/options/components/page-main.ts index bec8e6f..de95c71 100644 --- a/source/options/components/page-main.ts +++ b/source/options/components/page-main.ts @@ -1,4 +1,4 @@ -import {ConfirmButton} from '@holllo/gram'; +import {ConfirmButton, FeedbackButton} from '@holllo/gram'; import {html} from 'htm/preact'; import {Component} from 'preact'; import browser from 'webextension-polyfill'; @@ -99,7 +99,8 @@ export class PageMain extends Component { throw error; } - return; + // Return false to make the FeedbackButton not show feedback. + return false; } const bangs = this.state.bangs; @@ -197,7 +198,13 @@ export class PageMain extends Component { ${editorInputs}
- + <${FeedbackButton} + attributes=${{class: 'button'}} + click=${this.saveBang} + feedbackText="Saved" + text="Save" + timeout=${5 * 1000} + /> <${ConfirmButton} class="button destructive" click=${this.removeBang}