@@ -81,36 +81,38 @@ export default Ember.Mixin.create({
8181 this . sendAction ( 'changeDate' , value ) ;
8282 } ,
8383
84- _didChangeLanguage : Ember . observer ( 'language' , function ( ) {
85- this . $ ( ) . datepicker ( 'remove' ) ;
86- this . setupBootstrapDatepicker ( ) ;
87- } ) ,
84+ _addObservers : Ember . on ( 'didInsertElement' , function ( ) {
85+ this . addObserver ( 'language' , function ( ) {
86+ this . $ ( ) . datepicker ( 'remove' ) ;
87+ this . setupBootstrapDatepicker ( ) ;
88+ } ) ;
8889
89- _updateStartDate : Ember . observer ( 'startDate' , function ( ) {
90- this . $ ( ) . datepicker ( 'setStartDate' , this . get ( 'startDate' ) ) ;
91- this . _updateDatepicker ( ) ;
92- } ) ,
90+ this . addObserver ( 'startDate' , function ( ) {
91+ this . $ ( ) . datepicker ( 'setStartDate' , this . get ( 'startDate' ) ) ;
92+ this . _updateDatepicker ( ) ;
93+ } ) ;
9394
94- _updateEndDate : Ember . observer ( 'endDate' , function ( ) {
95- this . $ ( ) . datepicker ( 'setEndDate' , this . get ( 'endDate' ) ) ;
96- this . _updateDatepicker ( ) ;
97- } ) ,
95+ this . addObserver ( 'endDate' , function ( ) {
96+ this . $ ( ) . datepicker ( 'setEndDate' , this . get ( 'endDate' ) ) ;
97+ this . _updateDatepicker ( ) ;
98+ } ) ;
9899
99- _updateDatesDisabled : Ember . observer ( 'datesDisabled' , function ( ) {
100- this . $ ( ) . datepicker ( 'setDatesDisabled' , this . get ( 'datesDisabled' ) ) ;
101- this . _updateDatepicker ( ) ;
102- } ) ,
100+ this . addObserver ( 'datesDisabled' , function ( ) {
101+ this . $ ( ) . datepicker ( 'setDatesDisabled' , this . get ( 'datesDisabled' ) ) ;
102+ this . _updateDatepicker ( ) ;
103+ } ) ;
103104
104- _updateMinViewMode : Ember . observer ( 'minViewMode' , function ( ) {
105- this . $ ( ) . datepicker ( 'minViewMode' , this . get ( 'minViewMode' ) ) ;
106- this . $ ( ) . data ( 'datepicker' ) . _process_options ( { minViewMode : this . get ( 'minViewMode' ) } ) ;
107- this . _updateDatepicker ( ) ;
108- } ) ,
105+ this . addObserver ( 'minViewMode' , function ( ) {
106+ this . $ ( ) . datepicker ( 'minViewMode' , this . get ( 'minViewMode' ) ) ;
107+ this . $ ( ) . data ( 'datepicker' ) . _process_options ( { minViewMode : this . get ( 'minViewMode' ) } ) ;
108+ this . _updateDatepicker ( ) ;
109+ } ) ;
109110
110- _updateFomat : Ember . observer ( 'format' , function ( ) {
111- this . $ ( ) . datepicker ( 'format' , this . get ( 'format' ) ) ;
112- this . $ ( ) . data ( 'datepicker' ) . _process_options ( { format : this . get ( 'format' ) } ) ;
113- this . _updateDatepicker ( ) ;
111+ this . addObserver ( 'format' , function ( ) {
112+ this . $ ( ) . datepicker ( 'format' , this . get ( 'format' ) ) ;
113+ this . $ ( ) . data ( 'datepicker' ) . _process_options ( { format : this . get ( 'format' ) } ) ;
114+ this . _updateDatepicker ( ) ;
115+ } ) ;
114116 } ) ,
115117
116118 _updateDatepicker : function ( ) {
0 commit comments