@@ -108,43 +108,64 @@ function($scope,
108
108
109
109
self . scrollTop = function ( shouldAnimate ) {
110
110
self . resize ( ) . then ( function ( ) {
111
+ if ( ! scrollView ) {
112
+ return ;
113
+ }
111
114
scrollView . scrollTo ( 0 , 0 , ! ! shouldAnimate ) ;
112
115
} ) ;
113
116
} ;
114
117
115
118
self . scrollBottom = function ( shouldAnimate ) {
116
119
self . resize ( ) . then ( function ( ) {
120
+ if ( ! scrollView ) {
121
+ return ;
122
+ }
117
123
var max = scrollView . getScrollMax ( ) ;
118
124
scrollView . scrollTo ( max . left , max . top , ! ! shouldAnimate ) ;
119
125
} ) ;
120
126
} ;
121
127
122
128
self . scrollTo = function ( left , top , shouldAnimate ) {
123
129
self . resize ( ) . then ( function ( ) {
130
+ if ( ! scrollView ) {
131
+ return ;
132
+ }
124
133
scrollView . scrollTo ( left , top , ! ! shouldAnimate ) ;
125
134
} ) ;
126
135
} ;
127
136
128
137
self . zoomTo = function ( zoom , shouldAnimate , originLeft , originTop ) {
129
138
self . resize ( ) . then ( function ( ) {
139
+ if ( ! scrollView ) {
140
+ return ;
141
+ }
130
142
scrollView . zoomTo ( zoom , ! ! shouldAnimate , originLeft , originTop ) ;
131
143
} ) ;
132
144
} ;
133
145
134
146
self . zoomBy = function ( zoom , shouldAnimate , originLeft , originTop ) {
135
147
self . resize ( ) . then ( function ( ) {
148
+ if ( ! scrollView ) {
149
+ return ;
150
+ }
136
151
scrollView . zoomBy ( zoom , ! ! shouldAnimate , originLeft , originTop ) ;
137
152
} ) ;
138
153
} ;
139
154
140
155
self . scrollBy = function ( left , top , shouldAnimate ) {
141
156
self . resize ( ) . then ( function ( ) {
157
+ if ( ! scrollView ) {
158
+ return ;
159
+ }
142
160
scrollView . scrollBy ( left , top , ! ! shouldAnimate ) ;
143
161
} ) ;
144
162
} ;
145
163
146
164
self . anchorScroll = function ( shouldAnimate ) {
147
165
self . resize ( ) . then ( function ( ) {
166
+ if ( ! scrollView ) {
167
+ return ;
168
+ }
148
169
var hash = $location . hash ( ) ;
149
170
var elm = hash && $document [ 0 ] . getElementById ( hash ) ;
150
171
if ( ! ( hash && elm ) ) {
0 commit comments