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", [
2525 from : "=" ,
2626 to : "=" ,
2727 disable : "=" ,
28- onChange : "&onChange " ,
28+ onChange : "&" ,
2929 onFinish : "&"
3030 } ,
3131 replace : true ,
@@ -47,11 +47,17 @@ angular.module("ion.rangeslider").directive("ionRangeSlider", [
4747 to : $scope . to ,
4848 disable : $scope . disable ,
4949 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+ } ) ;
5256 } ) ;
5357 } ,
54- onFinish : $scope . onFinish
58+ onFinish : function ( ) {
59+ $scope . $apply ( $scope . onFinish ) ;
60+ }
5561 } ) ;
5662 var watchers = [ ] ;
5763 watchers . push ( $scope . $watch ( "min" , function ( value ) {
@@ -65,9 +71,20 @@ angular.module("ion.rangeslider").directive("ionRangeSlider", [
6571 } ) ;
6672 } ) ) ;
6773 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+ }
7188 } ) ) ;
7289 watchers . push ( $scope . $watch ( 'disable' , function ( value ) {
7390 $element . data ( "ionRangeSlider" ) . update ( {
You can’t perform that action at this time.
0 commit comments