@@ -96,51 +96,51 @@ function($animate, $timeout, $compile) {
96
96
_this . update ( ) ;
97
97
} , 50 ) ;
98
98
99
- this . updateLoop = ionic . debounce ( function ( ) {
100
- if ( _this . _options . loop ) {
99
+ this . updateLoop = ionic . debounce ( function ( ) {
100
+ if ( _this . _options . loop ) {
101
101
_this . __slider . updateLoop ( ) ;
102
102
}
103
103
} , 50 ) ;
104
104
105
- this . watchForChanges = function ( ) {
106
- if ( ! _watchHandler ) {
105
+ this . watchForChanges = function ( ) {
106
+ if ( ! _watchHandler ) {
107
107
// if we're not already watching, start watching
108
- _watchHandler = $scope . $watch ( function ( ) {
108
+ _watchHandler = $scope . $watch ( function ( ) {
109
109
console . log ( "Watch triggered" ) ;
110
110
_this . updateLoop ( ) ;
111
111
} ) ;
112
112
}
113
- }
113
+ } ;
114
114
115
- this . stopWatching = function ( ) {
116
- if ( _watchHandler ) {
115
+ this . stopWatching = function ( ) {
116
+ if ( _watchHandler ) {
117
117
console . log ( "Stopping watching..." ) ;
118
118
_watchHandler ( ) ;
119
119
_watchHandler = null ;
120
120
}
121
- }
121
+ } ;
122
122
123
- this . cleanUpEventHandlers = function ( ) {
124
- if ( _enterHandler ) {
123
+ this . cleanUpEventHandlers = function ( ) {
124
+ if ( _enterHandler ) {
125
125
_enterHandler ( ) ;
126
126
_enterHandler = null ;
127
127
}
128
128
129
- if ( _afterLeaveHandler ) {
129
+ if ( _afterLeaveHandler ) {
130
130
_afterLeaveHandler ( ) ;
131
131
_afterLeaveHandler = null ;
132
132
}
133
133
134
- if ( _modalRemovedHandler ) {
134
+ if ( _modalRemovedHandler ) {
135
135
_modalRemovedHandler ( ) ;
136
136
_modalRemovedHandler = null ;
137
137
}
138
138
139
- if ( _modalPresentedHandler ) {
139
+ if ( _modalPresentedHandler ) {
140
140
_modalPresentedHandler ( ) ;
141
141
_modalPresentedHandler = null ;
142
142
}
143
- }
143
+ } ;
144
144
145
145
this . getSlider = function ( ) {
146
146
return _this . __slider ;
@@ -164,7 +164,6 @@ function($animate, $timeout, $compile) {
164
164
$scope . slider = _this . __slider ;
165
165
166
166
$scope . $on ( '$destroy' , function ( ) {
167
- alert ( "scope destroy event" ) ;
168
167
slider . destroy ( ) ;
169
168
_this . __slider = null ;
170
169
_this . stopWatching ( ) ;
@@ -174,31 +173,27 @@ function($animate, $timeout, $compile) {
174
173
175
174
_this . watchForChanges ( ) ;
176
175
177
- _enterHandler = $scope . $on ( "$ionicView.enter" , function ( ) {
178
- console . log ( "enter" ) ;
176
+ _enterHandler = $scope . $on ( "$ionicView.enter" , function ( ) {
179
177
_this . watchForChanges ( ) ;
180
178
} ) ;
181
179
182
- _afterLeaveHandler = $scope . $on ( "$ionicView.afterLeave" , function ( ) {
183
- console . log ( "after leave" ) ;
180
+ _afterLeaveHandler = $scope . $on ( "$ionicView.afterLeave" , function ( ) {
184
181
_this . stopWatching ( ) ;
185
182
} ) ;
186
183
187
- _modalRemovedHandler = $scope . $on ( "$ionic.modalRemoved" , function ( ) {
188
- console . log ( "Modal removed" ) ;
184
+ _modalRemovedHandler = $scope . $on ( "$ionic.modalRemoved" , function ( ) {
189
185
_this . stopWatching ( ) ;
190
186
} ) ;
191
187
192
- _modalPresentedHandler = $scope . $on ( "$ionic.modalPresented" , function ( ) {
193
- console . log ( "Modal presented" ) ;
188
+ _modalPresentedHandler = $scope . $on ( "$ionic.modalPresented" , function ( ) {
194
189
_this . watchForChanges ( ) ;
195
190
} ) ;
196
191
197
192
} ) ;
198
193
199
194
} ] ,
200
195
201
- link : function ( $scope , element , attrs ) {
196
+ link : function ( $scope ) {
202
197
$scope . showPager = true ;
203
198
// Disable ngAnimate for slidebox and its children
204
199
//$animate.enabled(false, $element);
0 commit comments