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

Commit

Permalink
Bug 1237934 - Fix outline when focused on an app
Browse files Browse the repository at this point in the history
  • Loading branch information
jostw committed Jan 29, 2016
1 parent 467835e commit f3086d4
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 52 deletions.
62 changes: 30 additions & 32 deletions src/media/css/app-list.styl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,29 @@ $app-list-background-color = #CBCDCD;
margin: 2.9rem 2.6rem;

list-style: none;

&::before {
content: ".";

position: absolute;
top: 0;
left: 0;

color: $app-list-background-color;
}
}

.smart-button {
width: auto;
height: auto;

&.focused {
transform: scale(1.4);
}

&.pressed {
transform: scale(1.22);
}
}
}

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

width: 18.9rem;
height: 18.9rem;
outline: 0;
outline: 0 solid $greyscale-white;
-moz-outline-radius: 60%;

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

smart-button-animation();

&:focus {
outline: 0;
.focused & {
outline-width: .8rem;
}

&.focused {
transform: scale(1.4);

.icon {
outline: .8rem solid $greyscale-white;
}
}

&.pressed {
transform: scale(1.22);
.pressed & {
outline-width: 1rem;

transition-duration: .06s;

.icon {
outline: 1rem solid $greyscale-white;

transition-duration: .06s;
}
}

&.released {
.released & {
transition-duration: .16s;

.icon {
transition-duration: .16s;
}
}

.icon {
Expand All @@ -78,21 +84,13 @@ $app-list-background-color = #CBCDCD;
width: 100%;
height: 100%;
border-radius: 50%;
-moz-outline-radius: 60%;
outline: 0;
overflow: hidden;

color: $greyscale-light-grey;
background-color: $greyscale-light-grey;
background-size: 100% auto;
background-position: center center;

smart-button-animation();

&:focus {
outline: 0;
}

&::after {
content: attr(data-name);
box-sizing: border-box;
Expand Down
6 changes: 3 additions & 3 deletions src/media/js/views/homepage.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ define('views/homepage',
}
});

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

var callback = function() {
Expand Down Expand Up @@ -75,7 +75,7 @@ define('views/homepage',
return false;
});

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

Expand Down Expand Up @@ -170,7 +170,7 @@ define('views/homepage',
$appPreviewPrice.removeClass('hidden');
});

z.page.on('keyup', '.app-list-app', function(e) {
z.page.on('keyup', '.smart-button', function(e) {
if (e.keyCode !== window.KeyEvent.DOM_VK_RETURN || !caps.webApps) {
return;
}
Expand Down
36 changes: 19 additions & 17 deletions src/templates/homepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,26 @@
{% defer (url=api('apps'), id='app-list', pluck='objects', as='apps', key='id') %}
<ul class="clearfix">
{% for app in this %}
<li class="app-list-app focusable" data-id="{{ app.id }}">
{% if app.icons['128'] %}
<div class="icon" data-name="{{ app.name }}"
style="background-image: url('{{ app.icons['128'] }}');"></div>
{% elif app.icons['64'] %}
<div class="icon" data-name="{{ app.name }}"
style="background-image: url('{{ app.icons['64'] }}');"></div>
{% elif app.icons['48'] %}
<div class="icon" data-name="{{ app.name }}"
style="background-image: url('{{ app.icons['48'] }}');"></div>
{% elif app.icons['32'] %}
<div class="icon" data-name="{{ app.name }}"
style="background-image: url('{{ app.icons['32'] }}');"></div>
{% endif %}
<li class="smart-button focusable" data-id="{{ app.id }}">
<div class="app-list-app">
{% if app.icons['128'] %}
<div class="icon" data-name="{{ app.name }}"
style="background-image: url('{{ app.icons['128'] }}');"></div>
{% elif app.icons['64'] %}
<div class="icon" data-name="{{ app.name }}"
style="background-image: url('{{ app.icons['64'] }}');"></div>
{% elif app.icons['48'] %}
<div class="icon" data-name="{{ app.name }}"
style="background-image: url('{{ app.icons['48'] }}');"></div>
{% elif app.icons['32'] %}
<div class="icon" data-name="{{ app.name }}"
style="background-image: url('{{ app.icons['32'] }}');"></div>
{% endif %}

{% if app.tv_featured %}
<span class="star" data-icon="bookmark-on"></span>
{% endif %}
{% if app.tv_featured %}
<span class="star" data-icon="bookmark-on"></span>
{% endif %}
</div>
</li>
{% endfor %}
</ul>
Expand Down

0 comments on commit f3086d4

Please sign in to comment.