@@ -38,7 +38,7 @@ angular.module('ui.scroll', []).directive('uiScrollViewport', [
38
38
log = console . debug || console . log ;
39
39
match = $attr . uiScroll . match ( / ^ \s * ( \w + ) \s + i n \s + ( [ \w \. ] + ) \s * $ / ) ;
40
40
if ( ! match ) {
41
- throw new Error ( " Expected uiScroll in form of '_item_ in _datasource_' but got '" + $attr . uiScroll + "'" ) ;
41
+ throw new Error ( ' Expected uiScroll in form of \ '_item_ in _datasource_\ ' but got \'' + $attr . uiScroll + '\'' ) ;
42
42
}
43
43
itemName = match [ 1 ] ;
44
44
datasourceName = match [ 2 ] ;
@@ -81,7 +81,7 @@ angular.module('ui.scroll', []).directive('uiScrollViewport', [
81
81
if ( ! isDatasourceValid ( ) ) {
82
82
datasource = $injector . get ( datasourceName ) ;
83
83
if ( ! isDatasourceValid ( ) ) {
84
- throw new Error ( datasourceName + " is not a valid datasource" ) ;
84
+ throw new Error ( datasourceName + ' is not a valid datasource' ) ;
85
85
}
86
86
}
87
87
bufferSize = Math . max ( 3 , + $attr . bufferSize || 10 ) ;
@@ -97,7 +97,7 @@ angular.module('ui.scroll', []).directive('uiScrollViewport', [
97
97
var bottomPadding , createPadding , padding , repeaterType , topPadding , viewport ;
98
98
repeaterType = template [ 0 ] . localName ;
99
99
if ( repeaterType === 'dl' ) {
100
- throw new Error ( " ui-scroll directive does not support <" + template [ 0 ] . localName + " > as a repeating tag: " + template [ 0 ] . outerHTML ) ;
100
+ throw new Error ( ' ui-scroll directive does not support <' + template [ 0 ] . localName + ' > as a repeating tag: ' + template [ 0 ] . outerHTML ) ;
101
101
}
102
102
if ( repeaterType !== 'li' && repeaterType !== 'tr' ) {
103
103
repeaterType = 'div' ;
@@ -119,7 +119,7 @@ angular.module('ui.scroll', []).directive('uiScrollViewport', [
119
119
} ;
120
120
return result ;
121
121
default :
122
- result = angular . element ( "<" + repeaterType + " ></" + repeaterType + ">" ) ;
122
+ result = angular . element ( '<' + repeaterType + ' ></' + repeaterType + '>' ) ;
123
123
result . paddingHeight = result . height ;
124
124
return result ;
125
125
}
@@ -519,7 +519,7 @@ angular.module('ui.scroll', []).directive('uiScrollViewport', [
519
519
if ( angular . isArray ( newItems ) ) {
520
520
if ( newItems . length ) {
521
521
if ( newItems . length === 1 && newItems [ 0 ] === wrapper . scope [ itemName ] ) {
522
-
522
+ return inserted ;
523
523
} else {
524
524
ndx = wrapper . scope . $index ;
525
525
if ( ndx > first ) {
@@ -564,7 +564,7 @@ angular.module('ui.scroll', []).directive('uiScrollViewport', [
564
564
inserted = applyUpdate ( buffer [ arg1 - first ] , arg2 ) ;
565
565
}
566
566
} else {
567
- throw new Error ( " applyUpdates - " + arg1 + " is not a valid index or outside of range" ) ;
567
+ throw new Error ( ' applyUpdates - ' + arg1 + ' is not a valid index or outside of range' ) ;
568
568
}
569
569
}
570
570
return adjustBuffer ( ridActual , inserted ) ;
@@ -642,13 +642,13 @@ angular.module('ui.scroll', []).directive('uiScrollViewport', [
642
642
}
643
643
return adjustBuffer ( null , inserted ) ;
644
644
} ;
645
- eventListener . $on ( " insert.item" , function ( event , locator , item ) {
645
+ eventListener . $on ( ' insert.item' , function ( event , locator , item ) {
646
646
return doInsert ( locator , item ) ;
647
647
} ) ;
648
- eventListener . $on ( " update.items" , function ( event , locator , newItem ) {
648
+ eventListener . $on ( ' update.items' , function ( event , locator , newItem ) {
649
649
return doUpdate ( locator , newItem ) ;
650
650
} ) ;
651
- return eventListener . $on ( " delete.items" , function ( event , locator ) {
651
+ return eventListener . $on ( ' delete.items' , function ( event , locator ) {
652
652
return doDelete ( locator ) ;
653
653
} ) ;
654
654
} ;
0 commit comments