1
0
Fork 0

Add Dialog type id support for CSS styling

* src/ui/dialog/Dialog.js (setTypeId): Add method.
* src/ui/dialog/DialogDecorator.js (setTypeId): Add method.
* src/ui/dialog/JqueryDialog.js (setTypeId): Add method.
master
Mike Gerwitz 2017-11-08 11:11:40 -05:00
parent c41d0aa924
commit 72783a5f35
3 changed files with 45 additions and 2 deletions

View File

@ -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
*

View File

@ -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
*

View File

@ -60,19 +60,38 @@ module.exports = Class( 'JqueryDialog' )
*
* @return {undefined}
*/
__construct: function( jquery )
__construct: function( jquery, id )
{
this._jquery = jquery;
this._$dialog = this._jquery( '<div>' )
.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
*