Sfoglia il codice sorgente

Option for additional CSS class on dialogs

Vidar Tonaas Fauske 8 anni fa
parent
commit
976fa63e83
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 8 0
      src/dialog/index.ts

+ 8 - 0
src/dialog/index.ts

@@ -173,6 +173,11 @@ interface IDialogOptions {
    * The confirmation text for the OK button (defaults to 'OK').
    */
   okText?: string;
+
+  /**
+   * An additional CSS class to apply to the dialog.
+   */
+  dialogClass?: string;
 }
 
 
@@ -235,6 +240,9 @@ class Dialog extends Panel {
     let footer = new Widget({node: document.createElement('div')});
     let title = document.createElement('span');
     this.addClass(DIALOG_CLASS);
+    if (options.dialogClass) {
+      this.addClass(options.dialogClass);
+    }
     content.addClass(CONTENT_CLASS);
     header.addClass(HEADER_CLASS);
     body.addClass(BODY_CLASS);