diff --git a/src/ui/dialog/Dialog.js b/src/ui/dialog/Dialog.js index 44bd043..dd1a337 100644 --- a/src/ui/dialog/Dialog.js +++ b/src/ui/dialog/Dialog.js @@ -27,6 +27,18 @@ var Interface = require( 'easejs' ).Interface; */ module.exports = Interface( 'Dialog', { + /** + * Uniquely identify dialog type + * + * The `type_id` is exposed as a CSS class for styling. + * + * @param {string} type_id unique type identifier + * + * @return {Dialog} self + */ + 'public setTypeId': [ 'type_id' ], + + /** * Sets the dialog title * diff --git a/src/ui/dialog/DialogDecorator.js b/src/ui/dialog/DialogDecorator.js index 9f574c5..200ab0a 100644 --- a/src/ui/dialog/DialogDecorator.js +++ b/src/ui/dialog/DialogDecorator.js @@ -84,6 +84,18 @@ module.exports = AbstractClass }, + /** + * Uniquely identify dialog type + * + * The `type_id` is exposed as a CSS class for styling. + * + * @param {string} type_id unique type identifier + * + * @return {DialogDecorator} self + */ + 'public proxy setTypeId': '_dialog', + + /** * Sets the dialog title * diff --git a/src/ui/dialog/JqueryDialog.js b/src/ui/dialog/JqueryDialog.js index e195fb8..723594d 100644 --- a/src/ui/dialog/JqueryDialog.js +++ b/src/ui/dialog/JqueryDialog.js @@ -60,19 +60,38 @@ module.exports = Class( 'JqueryDialog' ) * * @return {undefined} */ - __construct: function( jquery ) + __construct: function( jquery, id ) { this._jquery = jquery; this._$dialog = this._jquery( '
' ) .dialog( { // don't show until we're ready - autoOpen: false + autoOpen: false, + + // default style + dialogClass: "liza.dialog", } ); }, + /** + * Uniquely identify dialog type + * + * The `type_id` is exposed as a CSS class for styling. + * + * @param {string} type_id unique type identifier + * + * @return {JqueryDialog} self + */ + 'public setTypeId': function( type_id ) + { + this._$dialog.dialog( { dialogClass: type_id } ); + return this; + }, + + /** * Sets the dialog title *