Skip to content

Commit

Permalink
Fix browser action on Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
quentin-st committed Apr 28, 2016
1 parent 78e67f6 commit b999489
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
15 changes: 6 additions & 9 deletions data/browser-action/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
@import '../../css/material-buttons';
@import '../../css/inputs';

$footer-height: 40px;

html, body {
margin: 0;
padding: 0;
width: 380px;
overflow-x: hidden;
overflow-y: auto;
}

body {
margin: 0;
padding: 0 0 #{$footer-height+15px} 0;
font-family: $roboto;
color: $color-text-dark;

Expand All @@ -31,7 +31,7 @@ body {
box-sizing: border-box;
}

header, .content, footer {
header, .content .part, footer {
padding: 5px 10px;
}

Expand Down Expand Up @@ -167,10 +167,7 @@ h2 {
}

footer {
position: absolute;
bottom: 0;
width: 100%;
height: $footer-height;
margin-top: 20px;
text-align: right;
@extend .primary-color--background;
@include transition-duration($timing-medium);
Expand Down
4 changes: 2 additions & 2 deletions data/browser-action/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ <h1>Material Freebox OS</h1>
</header>
<div class="content">
<div class="unsupported-wrap">
<div class="part-colors">
<div class="part part-colors">
<h2>Couleur primaire</h2>
<ul id="colors-primary"></ul>

<h2>Couleur secondaire</h2>
<ul id="colors-accent"></ul>
</div>
<div class="part-wallpapers">
<div class="part part-wallpapers">
<h2>Fond d'écran <a href="http://www.chromeup.com/chrome-os-wallpapers/" target="_blank" class="source">(source)</a></h2>

<ul id="wallpapers-images"></ul>
Expand Down
8 changes: 6 additions & 2 deletions data/browser-action/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,18 @@
var primaryColor_colors = primaryColorsUl.find('li'),
accentColor_colors = accentColorsUl.find('li');

if (!MaterialFreeboxOS.environment.isFirefox()) {
if (MaterialFreeboxOS.environment.isFirefox()) {
$('body')
.attr('data-color-primary', MaterialFreeboxOS.materialColors.defaultPrimary)
.attr('data-color-accent', MaterialFreeboxOS.materialColors.defaultAccent);
} else {
// Retrieve current settings
chrome.storage.local.get('color-primary', function (data) {
var defaultPrimaryColor = MaterialFreeboxOS.materialColors.defaultPrimary,
primaryColor = data['color-primary'] || defaultPrimaryColor;

primaryColor_colors.filter('[data-color="' + primaryColor + '"]').addClass('current');
$('body').attr('data-color-primary', primaryColor)
$('body').attr('data-color-primary', primaryColor);
});
chrome.storage.local.get('color-accent', function (data) {
var defaultAccentColor = MaterialFreeboxOS.materialColors.defaultAccent,
Expand Down

0 comments on commit b999489

Please sign in to comment.