@@ -2,23 +2,40 @@ enyo.kind({
2
2
name : "SelectDecorator" ,
3
3
classes : "onyx-button select-decorator" ,
4
4
handlers : {
5
- onchange : "changeHandler"
5
+ onchange : "changeHandler"
6
6
} ,
7
7
published : {
8
- disabled : false
8
+ disabled : false ,
9
+ showCaption : true ,
10
+ showArrow : true ,
11
+ icon : ""
12
+ } ,
13
+ showCaptionChanged : function ( ) {
14
+ this . $ . innerText . setShowing ( this . showCaption ) ;
15
+ this . addRemoveClass ( "select-decorator-no-caption" , ! this . showCaption ) ;
9
16
} ,
10
17
disabledChanged : function ( ) {
11
18
this . addRemoveClass ( "select-decorator-disabled" , this . disabled ) ;
12
19
} ,
20
+ showArrowChanged : function ( ) {
21
+ this . addRemoveClass ( "select-decorator-no-arrow" , ! this . showArrow ) ;
22
+ } ,
23
+ iconChanged : function ( ) {
24
+ this . $ . innerIcon . setStyle ( "background-image: url('" + this . icon + "')" ) ;
25
+ this . $ . innerIcon . setShowing ( ( this . icon !== "" ) ) ;
26
+ } ,
13
27
create : function ( ) {
14
28
this . inherited ( arguments ) ;
15
29
this . disabledChanged ( ) ;
30
+ this . showCaptionChanged ( ) ;
31
+ this . showArrowChanged ( ) ;
32
+ this . iconChanged ( ) ;
16
33
} ,
17
34
rendered : function ( ) {
18
35
this . inherited ( arguments ) ;
19
36
var select = this . getClientControls ( ) [ 0 ] ;
20
37
21
- if ( select ) {
38
+ if ( select ) {
22
39
this . changeHandler ( select ) ;
23
40
}
24
41
} ,
@@ -27,9 +44,10 @@ enyo.kind({
27
44
this . $ . innerText . setContent ( caption ) ;
28
45
} ,
29
46
components : [
30
- { kind : "FittableColumns" , noStretch : true , classes : "select-decorator-inner" , components : [
31
- { name : "innerText" , fit : true , classes : "select-decorator-inner-text" } ,
32
- { classes : "select-decorator-inner-arrow" }
47
+ { classes : "select-decorator-inner" , components : [
48
+ { classes : "select-decorator-inner-arrow" } ,
49
+ { name : "innerIcon" , classes : "select-decorator-inner-icon" } ,
50
+ { name : "innerText" , fit : true , classes : "select-decorator-inner-text" }
33
51
] }
34
52
]
35
53
} ) ;
0 commit comments