File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -197,25 +197,21 @@ angular.module('ui.scroll', [])
197
197
}
198
198
199
199
function Padding ( template ) {
200
- var div , result , table , tagName ;
201
- tagName = template . localName ;
202
-
203
- if ( tagName === 'dl' ) {
204
- throw new Error ( 'ui-scroll directive does not support <' + tagName + '> as a repeating tag: ' + template . outerHTML ) ;
205
- }
206
-
207
- if ( tagName !== 'li' && tagName !== 'tr' ) {
208
- tagName = 'div' ;
209
- }
200
+ let result ;
201
+ let tagName = template . localName ;
210
202
211
203
switch ( tagName ) {
204
+ case 'dl' :
205
+ throw new Error ( `ui-scroll directive does not support <${ tagName } > as a repeating tag: ${ template . outerHTML } ` ) ;
212
206
case 'tr' :
213
- table = angular . element ( '<table><tr><td><div></div></td></tr></table>' ) ;
214
- div = table . find ( 'div' ) ;
207
+ let table = angular . element ( '<table><tr><td><div></div></td></tr></table>' ) ;
215
208
result = table . find ( 'tr' ) ;
216
209
break ;
210
+ case 'li' :
211
+ result = angular . element ( '<li></li>' ) ;
212
+ break ;
217
213
default :
218
- result = angular . element ( '<' + tagName + ' ></' + tagName + ' >') ;
214
+ result = angular . element ( '<div ></div >' ) ;
219
215
}
220
216
221
217
return result ;
You can’t perform that action at this time.
0 commit comments