1 ( function ( $, undefined ) {
3 $.widget( "todons.colorwidget", $.mobile.widget, {
10 isInput: this.element.is( "input" )
13 /* "value", if present, takes precedence over "data-color" */
15 if ( this.element.attr( "value" ).match(/#[0-9A-Fa-f]{6}/) ) {
16 this.element.attr( "data-color", this.element.attr( "value" ) );
20 $.mobile.todons.parseOptions( this, true );
23 _setOption: function ( key, value, unconditional ) {
24 if ( undefined === unconditional ) {
25 unconditional = false;
28 if ( key === "color" ) {
29 this._setColor(value, unconditional);
33 _setColor: function ( value, unconditional ) {
34 if ( value.match(/#[0-9A-Fa-f]{6}/) && ( value != this.options.color || unconditional ) ) {
35 this.options.color = value;
36 this.element.attr( "data-color", value );
39 this.element.attr( "value", value );
42 this.element.triggerHandler( "colorchanged", value );