File tree Expand file tree Collapse file tree 1 file changed +24
-7
lines changed Expand file tree Collapse file tree 1 file changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ angular.module("ion.rangeslider").directive("ionRangeSlider", [
25
25
from : "=" ,
26
26
to : "=" ,
27
27
disable : "=" ,
28
- onChange : "&onChange " ,
28
+ onChange : "&" ,
29
29
onFinish : "&"
30
30
} ,
31
31
replace : true ,
@@ -47,11 +47,17 @@ angular.module("ion.rangeslider").directive("ionRangeSlider", [
47
47
to : $scope . to ,
48
48
disable : $scope . disable ,
49
49
onChange : function ( a ) {
50
- $scope . onChange && $scope . onChange ( {
51
- a : a
50
+ $scope . $apply ( function ( ) {
51
+ $scope . from = a . from ;
52
+ $scope . to = a . to ;
53
+ $scope . onChange && $scope . onChange ( {
54
+ a : a
55
+ } ) ;
52
56
} ) ;
53
57
} ,
54
- onFinish : $scope . onFinish
58
+ onFinish : function ( ) {
59
+ $scope . $apply ( $scope . onFinish ) ;
60
+ }
55
61
} ) ;
56
62
var watchers = [ ] ;
57
63
watchers . push ( $scope . $watch ( "min" , function ( value ) {
@@ -65,9 +71,20 @@ angular.module("ion.rangeslider").directive("ionRangeSlider", [
65
71
} ) ;
66
72
} ) ) ;
67
73
watchers . push ( $scope . $watch ( 'from' , function ( value ) {
68
- $element . data ( "ionRangeSlider" ) . update ( {
69
- from : value
70
- } ) ;
74
+ var slider = $element . data ( "ionRangeSlider" ) ;
75
+ if ( slider . old_from !== value ) {
76
+ slider . update ( {
77
+ from : value
78
+ } ) ;
79
+ }
80
+ } ) ) ;
81
+ watchers . push ( $scope . $watch ( 'to' , function ( value ) {
82
+ var slider = $element . data ( "ionRangeSlider" ) ;
83
+ if ( slider . old_to !== value ) {
84
+ slider . update ( {
85
+ to : value
86
+ } ) ;
87
+ }
71
88
} ) ) ;
72
89
watchers . push ( $scope . $watch ( 'disable' , function ( value ) {
73
90
$element . data ( "ionRangeSlider" ) . update ( {
You can’t perform that action at this time.
0 commit comments