File tree Expand file tree Collapse file tree 3 files changed +50
-9
lines changed
components/custom-progress-bar Expand file tree Collapse file tree 3 files changed +50
-9
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,12 @@ export default JquiProgressBarComponent.extend({
15
15
_this . animate ( ) ;
16
16
} , 30 ) ;
17
17
} . on ( 'didInsertElement' ) ,
18
- complete : function ( ) {
19
- var _this = this ;
20
- Ember . run . next ( function ( ) {
21
- _this . set ( 'text' , "Complete!" ) ;
22
- } ) ;
18
+ uiActions : {
19
+ complete : function ( ) {
20
+ var _this = this ;
21
+ Ember . run . next ( function ( ) {
22
+ _this . set ( 'text' , "Complete!" ) ;
23
+ } ) ;
24
+ }
23
25
}
24
26
} ) ;
Original file line number Diff line number Diff line change @@ -3,14 +3,15 @@ import Ember from 'ember';
3
3
export default Ember . ObjectController . extend ( {
4
4
num : 50 ,
5
5
vals : [ 10 , 90 ] ,
6
- text : "50%" ,
7
6
num2 : 50 ,
7
+ num3 : 50 ,
8
+ text : "" ,
8
9
didSlideBasic : function ( ) {
9
10
this . set ( 'num2' , this . get ( 'num' ) ) ;
10
11
} . observes ( 'num' ) ,
11
12
actions : {
12
13
didSlide : function ( event , ui ) {
13
- this . set ( 'text' , ui . value + "% " ) ;
14
+ this . set ( 'text' , this . get ( 'text' ) + "_ " ) ;
14
15
}
15
16
}
16
17
} ) ;
Original file line number Diff line number Diff line change 6
6
{{ jqui-slider values =vals min =0 max =100 step =10 range =true }} {{ vals.firstObject }} - {{ vals.lastObject }}
7
7
<p >Just add <code >\{{ jqui-slider values =vals min =0 max =100 step =10 range =true }} \{{ vals.firstObject }} - \{{ vals.lastObject }} </code > to any template in your application.</p >
8
8
9
- <h2 >Custom Slider</h2 >
10
- {{ jqui-slider value =num2 min =0 max =100 step =10 slideAction =" didSlide" }} {{ text }}
9
+ <h2 >One Way Controlled Slider</h2 >
10
+ <p >Controlled by the basic slider above.</p >
11
+ {{ jqui-slider value =num2 min =0 max =100 step =10 }} {{ num2 }}
12
+
13
+ <h4 >Template:</h4 >
14
+ <p ><code >\{{ jqui-slider value =num2 min =0 max =100 step =10 }} \{{ num2 }} </code ></p >
15
+
16
+ <h4 >Controller:</h4 >
17
+ <p ><code ><pre >
18
+ import Ember from 'ember';
19
+
20
+ export default Ember.ObjectController.extend({
21
+ num: 50,
22
+ num2: 50,
23
+ didSlideBasic: function() {
24
+ this.set('num2', this.get('num'));
25
+ }.observes('num')
26
+ });
27
+ </pre ></code ></p >
28
+
29
+ <h2 >Slider with action</h2 >
30
+ {{ jqui-slider value =num3 min =0 max =100 step =10 slide =" didSlide" }} {{ num3 }} <br >{{ text }}
31
+
32
+ <h4 >Template:</h4 >
33
+ <p ><code >\{{ jqui-slider value =num3 min =0 max =100 step =10 slide =" didSlide" }} \{{ num3 }} < br> \{{ text }} </code ></p >
34
+
35
+ <h4 >Controller:</h4 >
36
+ <p ><code ><pre >
37
+ import Ember from 'ember';
38
+
39
+ export default Ember.ObjectController.extend({
40
+ num3: 50,
41
+ text: "",
42
+ actions: {
43
+ didSlide: function(event, ui) {
44
+ this.set('text', this.get('text') + "_");
45
+ }
46
+ }
47
+ });
48
+ </pre ></code ></p >
You can’t perform that action at this time.
0 commit comments