Skip to content

Commit 07e6a20

Browse files
committed
Do not bindonce ng-repeat, remove translateZ(0) optimisation - address dangling DOM nodes after ng-repeat finishes.
angular/angular.js#4490
1 parent 06c5ffb commit 07e6a20

File tree

3 files changed

+14
-20
lines changed

3 files changed

+14
-20
lines changed

app/assets/stylesheets/darkswarm/animations.sass

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
100%
5656
opacity: 1
5757

58-
@-webkit-keyframes spin
58+
@-webkit-keyframes spin
5959
0%
6060
-webkit-transform: rotate(0deg)
6161
transform: rotate(0deg)
@@ -104,12 +104,10 @@
104104

105105

106106
.animate-repeat
107-
-webkit-transform: translateZ(0)
108-
transform: translateZ(0)
109107
&.ng-move, &.ng-enter, &.ng-leave
110-
-webkit-transition: all 300ms linear
111-
transition: all 300ms linear
112-
108+
-webkit-transition: all 300ms linear
109+
transition: all 300ms linear
110+
113111
&.ng-leave
114112
opacity: 1
115113
&.ng-leave-active
@@ -178,7 +176,7 @@ product.animate-repeat
178176
overflow: hidden
179177
max-height: 0
180178
opacity: 0 !important
181-
179+
182180
// &.ng-hide-add-active, &.ng-hide-remove-active
183181
184182
&.ng-hide-add, &.ng-hide-remove
@@ -197,7 +195,7 @@ product.animate-repeat
197195

198196
&.ng-hide
199197
opacity: 0 !important
200-
198+
201199
// &.ng-hide-add-active, &.ng-hide-remove-active
202200
203201
&.ng-hide-add, &.ng-hide-remove
@@ -206,8 +204,8 @@ product.animate-repeat
206204
it as hidden. */
207205
display: block !important
208206

209-
210-
207+
208+
211209

212210

213211
@mixin csstrans
@@ -217,7 +215,3 @@ product.animate-repeat
217215
-o-transition: all 300ms ease
218216
transition: all 300ms ease
219217
-webkit-transform-style: preserve-3d
220-
221-
222-
223-

app/views/home/_fat.html.haml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
.row.active_table_row{"ng-show" => "open()", "ng-click" => "toggle($event)", "ng-class" => "{'open' : !ofn-i_032-closed-sign()}"}
1+
.row.active_table_row{"ng-show" => "open()", "ng-click" => "toggle($event)", "ng-class" => "{'open' : !ofn-i_032-closed-sign()}", bindonce: true}
22
.columns.small-12.medium-6.large-5.fat
33
%div{"bo-if" => "hub.taxons"}
44
%label Shop for
55
.trans-sentence
66
%span.fat-taxons{"ng-repeat" => "taxon in hub.taxons"}
77
%render-svg{path: "{{taxon.icon}}"}
8-
%span{"bo-text" => "taxon.name"}
8+
%span{"bo-text" => "taxon.name"}
99
%div.show-for-medium-up{"bo-if" => "hub.taxons.length==0"}
1010
 
1111
.columns.small-12.medium-3.large-2.fat
1212
%div{"bo-if" => "hub.pickup || hub.delivery"}
1313
%label Delivery options
1414
%ul.small-block-grid-2.medium-block-grid-1.large-block-grid-1
15-
%li.pickup{"bo-if" => "hub.pickup"}
15+
%li.pickup{"bo-if" => "hub.pickup"}
1616
%i.ofn-i_038-takeaway
1717
Pickup
18-
%li.delivery{"bo-if" => "hub.delivery"}
18+
%li.delivery{"bo-if" => "hub.delivery"}
1919
%i.ofn-i_039-delivery
2020
Delivery
2121
.columns.small-12.medium-3.large-5.fat

app/views/home/_hubs.html.haml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
= render "shared/components/enterprise_search"
99
= render "home/filters"
1010
11-
.row{bindonce: true}
11+
.row
1212
.small-12.columns
1313
.name-matches{"ng-show" => "nameMatches.length > 0"}
1414
%h2 Did you mean?
1515
= render "home/hubs_table", enterprises: "nameMatches"
1616
17-
.distance-matches{"ng-show" => "nameMatches.length == 0 || distanceMatchesShown"}
17+
.distance-matches{"ng-if" => "nameMatches.length == 0 || distanceMatchesShown"}
1818
%h2
1919
Closest to
2020
%span{"ng-show" => "nameMatches.length > 0"} {{ nameMatches[0].name }}...

0 commit comments

Comments
 (0)