Ver código fonte

ref: rename stuff

Sv443 1 ano atrás
pai
commit
7db71c736f

+ 2 - 2
contributing.md

@@ -936,7 +936,7 @@ The usage and example blocks on each are written in TypeScript but can be used i
 > | `closeOnEscPress?: boolean` | Whether the dialog should close when the escape key is pressed - defaults to true |
 > | `closeBtnEnabled?: boolean` | Whether the close button should be enabled - defaults to true |
 > | `destroyOnClose?: boolean` | Whether the dialog should be destroyed when it's closed - defaults to false |
-> | `smallDialog?: boolean` | Whether the menu should have a smaller overall appearance - defaults to false |
+> | `small?: boolean` | Whether the menu should have a smaller overall appearance - defaults to false |
 > | `renderBody: () => HTMLElement │ Promise<HTMLElement>` | Called to render the body of the dialog |
 > | `renderHeader?: () => HTMLElement │ Promise<HTMLElement>` | Called to render the header of the dialog - leave undefined for a blank header |
 > | `renderFooter?: () => HTMLElement │ Promise<HTMLElement>` | Called to render the footer of the dialog - leave undefined for no footer |
@@ -996,7 +996,7 @@ The usage and example blocks on each are written in TypeScript but can be used i
 >   closeOnEscPress: true,
 >   closeBtnEnabled: true,
 >   destroyOnClose: false,
->   smallDialog: true,
+>   small: true,
 >   // add elements to the header, body and footer here, in one of these ways:
 >   // - foo.appendChild(document.createElement("..."));
 >   // - foo.innerHTML = "..."

+ 11 - 11
src/components/BytmDialog.ts

@@ -22,8 +22,8 @@ export interface BytmDialogOptions {
   destroyOnClose?: boolean;
   /** Whether the dialog should be unmounted when it's closed - defaults to false */
   unmountOnClose?: boolean;
-  /** Whether the menu should have a smaller overall appearance - defaults to false */
-  smallDialog?: boolean;
+  /** Whether the dialog should have a smaller overall appearance - defaults to false */
+  small?: boolean;
   /** Called to render the body of the dialog */
   renderBody: () => HTMLElement | Promise<HTMLElement>;
   /** Called to render the header of the dialog - leave undefined for a blank header */
@@ -255,7 +255,7 @@ export class BytmDialog extends NanoEmitter<{
 
     const headerWrapperEl = document.createElement("div");
     headerWrapperEl.classList.add("bytm-dialog-header");
-    this.options.smallDialog && headerWrapperEl.classList.add("small");
+    this.options.small && headerWrapperEl.classList.add("small");
 
     if(header) {
       const headerTitleWrapperEl = document.createElement("div");
@@ -270,14 +270,14 @@ export class BytmDialog extends NanoEmitter<{
     else {
       // insert element to pad the header height
       const padEl = document.createElement("div");
-      padEl.classList.add("bytm-dialog-header-pad", this.options.smallDialog ? "small" : "");
+      padEl.classList.add("bytm-dialog-header-pad", this.options.small ? "small" : "");
       headerWrapperEl.appendChild(padEl);
     }
 
     if(this.options.closeBtnEnabled) {
       const closeBtnEl = document.createElement("img");
       closeBtnEl.classList.add("bytm-dialog-close");
-      this.options.smallDialog && closeBtnEl.classList.add("small");
+      this.options.small && closeBtnEl.classList.add("small");
       closeBtnEl.src = await getResourceUrl("img-close");
       closeBtnEl.role = "button";
       closeBtnEl.tabIndex = 0;
@@ -290,15 +290,15 @@ export class BytmDialog extends NanoEmitter<{
 
     //#SECTION body
 
-    const menuBodyElem = document.createElement("div");
-    menuBodyElem.id = `bytm-${this.id}-dialog-body`;
-    menuBodyElem.classList.add("bytm-dialog-body");
-    this.options.smallDialog && menuBodyElem.classList.add("small");
+    const dialogBodyElem = document.createElement("div");
+    dialogBodyElem.id = `bytm-${this.id}-dialog-body`;
+    dialogBodyElem.classList.add("bytm-dialog-body");
+    this.options.small && dialogBodyElem.classList.add("small");
 
     const body = this.options.renderBody();
 
-    menuBodyElem.appendChild(body instanceof Promise ? await body : body);
-    dialogWrapperEl.appendChild(menuBodyElem);
+    dialogBodyElem.appendChild(body instanceof Promise ? await body : body);
+    dialogWrapperEl.appendChild(dialogBodyElem);
 
     //#SECTION footer
 

+ 1 - 1
src/dialogs/featHelp.ts

@@ -22,7 +22,7 @@ export async function getFeatHelpDialog({
       closeOnBgClick: true,
       closeOnEscPress: true,
       destroyOnClose: true,
-      smallDialog: true,
+      small: true,
       renderHeader,
       renderBody: () => renderBody({ featKey }),
     });

+ 1 - 1
src/dialogs/versionNotif.ts

@@ -27,7 +27,7 @@ export async function getVersionNotifDialog({
       closeOnBgClick: false,
       closeOnEscPress: true,
       destroyOnClose: true,
-      smallDialog: true,
+      small: true,
       renderHeader,
       renderBody: () => renderBody({
         latestTag,