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
parent
c41d0aa924
commit
72783a5f35
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue