rectest/scripts/ColorTestCase.js

42 lines
845 B
JavaScript
Raw Normal View History

2012-03-03 12:06:40 -05:00
rectest.ColorTestCase = Class( 'ColorTestCase' )
.implement( rectest.TestCase )
.extend(
{
'private static _sets': [
[ 'red', 'blue', 'green', 'yellow' ],
[ 'white', 'orange', 'black' ],
[ 'purple', 'brown', 'gray' ]
],
/**
* Element to contain color
* @var {jQuery}
*/
'private _$color': null,
2012-03-03 12:06:40 -05:00
'public getSet': function( set_id )
{
return this.__self.$( '_sets' )[ 0 ];
},
'public initRender': function( $element )
{
$element.append( this._$color = $( '<div>' )
.addClass( 'color-display' )
);
},
2012-03-03 12:06:40 -05:00
'public render': function( id, $element )
{
this._$color.css( 'background-color', id );
2012-03-03 12:06:40 -05:00
}
} );
// TODO: move
rectest.cases.colors = {
title: 'Colors',
testCase: rectest.ColorTestCase
};