Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Commit c2da1b4

Browse files
committed
Merge pull request #39 from jostw/josyeh/Marketplace/master/Bug1237934
Bug 1237934 - [TV][2.5][Web Apps] After grid view scroll down, move focus to top-left app will show a flicker square border
2 parents 467835e + f3086d4 commit c2da1b4

File tree

3 files changed

+52
-52
lines changed

3 files changed

+52
-52
lines changed

src/media/css/app-list.styl

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,29 @@ $app-list-background-color = #CBCDCD;
2626
margin: 2.9rem 2.6rem;
2727

2828
list-style: none;
29+
30+
&::before {
31+
content: ".";
32+
33+
position: absolute;
34+
top: 0;
35+
left: 0;
36+
37+
color: $app-list-background-color;
38+
}
39+
}
40+
41+
.smart-button {
42+
width: auto;
43+
height: auto;
44+
45+
&.focused {
46+
transform: scale(1.4);
47+
}
48+
49+
&.pressed {
50+
transform: scale(1.22);
51+
}
2952
}
3053
}
3154

@@ -34,42 +57,25 @@ $app-list-background-color = #CBCDCD;
3457

3558
width: 18.9rem;
3659
height: 18.9rem;
37-
outline: 0;
60+
outline: 0 solid $greyscale-white;
61+
-moz-outline-radius: 60%;
3862

3963
background-color: $app-list-background-color;
4064

4165
smart-button-animation();
4266

43-
&:focus {
44-
outline: 0;
67+
.focused & {
68+
outline-width: .8rem;
4569
}
4670

47-
&.focused {
48-
transform: scale(1.4);
49-
50-
.icon {
51-
outline: .8rem solid $greyscale-white;
52-
}
53-
}
54-
55-
&.pressed {
56-
transform: scale(1.22);
71+
.pressed & {
72+
outline-width: 1rem;
5773

5874
transition-duration: .06s;
59-
60-
.icon {
61-
outline: 1rem solid $greyscale-white;
62-
63-
transition-duration: .06s;
64-
}
6575
}
6676

67-
&.released {
77+
.released & {
6878
transition-duration: .16s;
69-
70-
.icon {
71-
transition-duration: .16s;
72-
}
7379
}
7480

7581
.icon {
@@ -78,21 +84,13 @@ $app-list-background-color = #CBCDCD;
7884
width: 100%;
7985
height: 100%;
8086
border-radius: 50%;
81-
-moz-outline-radius: 60%;
82-
outline: 0;
8387
overflow: hidden;
8488

8589
color: $greyscale-light-grey;
8690
background-color: $greyscale-light-grey;
8791
background-size: 100% auto;
8892
background-position: center center;
8993

90-
smart-button-animation();
91-
92-
&:focus {
93-
outline: 0;
94-
}
95-
9694
&::after {
9795
content: attr(data-name);
9896
box-sizing: border-box;

src/media/js/views/homepage.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ define('views/homepage',
4343
}
4444
});
4545

46-
z.page.on('sn:willfocus', '.app-list-app', function() {
46+
z.page.on('sn:willfocus', '.smart-button', function() {
4747
SpatialNavigation.pause();
4848

4949
var callback = function() {
@@ -75,7 +75,7 @@ define('views/homepage',
7575
return false;
7676
});
7777

78-
z.page.on('focus', '.app-list-app', function() {
78+
z.page.on('focus', '.smart-button', function() {
7979
var focusedApp = appsModel.lookup(this.dataset.id);
8080
var focusedManifestURL = focusedApp.manifest_url;
8181

@@ -170,7 +170,7 @@ define('views/homepage',
170170
$appPreviewPrice.removeClass('hidden');
171171
});
172172

173-
z.page.on('keyup', '.app-list-app', function(e) {
173+
z.page.on('keyup', '.smart-button', function(e) {
174174
if (e.keyCode !== window.KeyEvent.DOM_VK_RETURN || !caps.webApps) {
175175
return;
176176
}

src/templates/homepage.html

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,26 @@
44
{% defer (url=api('apps'), id='app-list', pluck='objects', as='apps', key='id') %}
55
<ul class="clearfix">
66
{% for app in this %}
7-
<li class="app-list-app focusable" data-id="{{ app.id }}">
8-
{% if app.icons['128'] %}
9-
<div class="icon" data-name="{{ app.name }}"
10-
style="background-image: url('{{ app.icons['128'] }}');"></div>
11-
{% elif app.icons['64'] %}
12-
<div class="icon" data-name="{{ app.name }}"
13-
style="background-image: url('{{ app.icons['64'] }}');"></div>
14-
{% elif app.icons['48'] %}
15-
<div class="icon" data-name="{{ app.name }}"
16-
style="background-image: url('{{ app.icons['48'] }}');"></div>
17-
{% elif app.icons['32'] %}
18-
<div class="icon" data-name="{{ app.name }}"
19-
style="background-image: url('{{ app.icons['32'] }}');"></div>
20-
{% endif %}
7+
<li class="smart-button focusable" data-id="{{ app.id }}">
8+
<div class="app-list-app">
9+
{% if app.icons['128'] %}
10+
<div class="icon" data-name="{{ app.name }}"
11+
style="background-image: url('{{ app.icons['128'] }}');"></div>
12+
{% elif app.icons['64'] %}
13+
<div class="icon" data-name="{{ app.name }}"
14+
style="background-image: url('{{ app.icons['64'] }}');"></div>
15+
{% elif app.icons['48'] %}
16+
<div class="icon" data-name="{{ app.name }}"
17+
style="background-image: url('{{ app.icons['48'] }}');"></div>
18+
{% elif app.icons['32'] %}
19+
<div class="icon" data-name="{{ app.name }}"
20+
style="background-image: url('{{ app.icons['32'] }}');"></div>
21+
{% endif %}
2122

22-
{% if app.tv_featured %}
23-
<span class="star" data-icon="bookmark-on"></span>
24-
{% endif %}
23+
{% if app.tv_featured %}
24+
<span class="star" data-icon="bookmark-on"></span>
25+
{% endif %}
26+
</div>
2527
</li>
2628
{% endfor %}
2729
</ul>

0 commit comments

Comments
 (0)